/*REQUIRES jQUERY */
$(function(){
    
    function processSearch(inputID) {
        var inputVal = $('#'+inputID).val();
        var searchPage = '/Search.aspx';
        var cseAPIcx = '011120253064383584234:bfhcnkdv8nc';
        var cseAPIcof = "FORID:11";
        var cseAPIie = "UTF-8";
        window.location = searchPage+'?cx='+cseAPIcx+'&cof='+cseAPIcof+'&ie='+cseAPIie+'&q=' + inputVal;
        //window.location = /Search.aspx?cx=011120253064383584234:bfhcnkdv8nc&cof=FORID:11&ie=UTF-8&q=' + inputVal;
    }
    
    $('#ctl00_Header1_submitGoogleSearchCSE').click(function(){processSearch('ctl00_Header1_googleSearchCSE');});//remember to use .net modified id's
    $('#cseSearchFormSubmit').click(function(){processSearch('cseSearchFormInput');});

});