// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function quicklinks() 
{
    var theselect = document.getElementById("qlselect");
            var theurl = theselect.options[theselect.selectedIndex].value;
            if(theurl.indexOf("%") != -1) theurl = decode(theurl);
    //document.getElementById("quicklinks").action = theurl;
            window.location = theurl;
}

function decode(starturl)
{
    var endurl = "";
    for(var i = 0; i < starturl.length; i++)
    {
            if(starturl.charAt(i) != "%")
                    endurl += starturl.charAt(i);
            else
                    endurl += unescape(starturl.charAt(i++)+starturl.charAt(i++)+starturl.charAt(i));
    }
    return endurl;
}

function showHide(hidden_id, show) {
    
    var hidden_item = document.getElementById(hidden_id);
    if (show == true) {
        hidden_item.style.display = 'inline';
    }
    else {
        hidden_item.style.display = 'none';
    }
    return;
}

function checksearch(form) {
    if(form.query.value == "" || form.query.value == "Enter search terms") {
        alert("Please enter some search terms");
        return false;
    }
    return true;
}