
function submitSearch(obj){
    var url = "http://";
    url += window.location.host;
    url += "/";
    url += urlEncode(obj.value);
    url += "-search/search.htm";
    window.location.href = url;
    return false;
}

function urlEncode(str){
    var strEncoded;
    strEncoded = str.toLowerCase();
    // Remove spaces at the beginning
    strEncoded = strEncoded.replace(/^(\s+)/g, "");
    // Remove spaces at the end
    strEncoded = strEncoded.replace(/(\s+)$/g, "");
    strEncoded = strEncoded.replace(/[^0-9a-z]/g, " ");
    strEncoded = strEncoded.replace(/\s+/g, " ");
    strEncoded = strEncoded.replace(/\s+/g, " ");
    strEncoded = strEncoded.replace(/\s/g, "+");
    return strEncoded;
}