function SubmitAdvSrchForm(someElement, srchUrl) {
    // Find the aspnetForm element.
    var formElement;
    formElement = someElement; 
    while (formElement.nodeName != "FORM")
    {
        formElement = formElement.parentNode;
    }
    // Pretend that the form just does a POST to the page we want.
	// ... with no __VIEWSTATE, so that ASP.NET doesn't get confused.
    formElement.method="POST";
    formElement.action=srchUrl;
    formElement.__VIEWSTATE.value = "";

    // Blank out the other search input control.
    var i;
    for (i=0; i < formElement.elements.length; i++) {
        if (formElement.elements[i].id.indexOf("baSearchBar_SearchText") > -1) {
            var sbst;
            sbst = formElement.elements[i];
            sbst.id = "wubba";
            sbst.name = "wubba";
        }
    }

    formElement.submit();
}

function onEnterpress(target, e)
{
    //define any varible
    var KeyPress; 

    //if which property of event object is supported 
    if(e && e.which)
    {
        e = e;
        //character code is contained in NN4's which property
        KeyPress = e.which;
    }

    else
    {
        e = event;
        KeyPress = e.keyCode;
    }  

    //13 is the key code of enter key
    if(KeyPress == 13)
    {
        SubmitAdvSrchForm(target, "/search/results.aspx");
        //WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("nameprefix$ASB_BS_SRCH_1", "", false, "", "/search/results.aspx", false, false));
        return false;
    }
    else
    {
        return true;
    }

}
