function onEnter(form, e, strParam) {
  var keycode;
  if (window.event) keycode = window.event.keyCode;
  else if (e) keycode = e.which;
  else return true;
  if (keycode == 13) {
    submit_form (form, strParam);
    return false;
  } else return true;
}
function submit_form()
{ 
    var arrArgs = submit_form.arguments;
    var oForm = arrArgs[0];
    var strParam = arrArgs[1];
    var strInput, strType;

    if (strParam == 'ss')
    { 
        if ("[" + typeof(oForm.query.value) + "]"!="[undefined]")
        { 
            strInput = oForm.query.value
        }
        else
        { 
            strInput = '';
        }
        
        window.location.href = "/search/default.aspx?Collection=GetawayTravelv2&query="+strInput;
    }
    else if (strParam == 'es')
    {
        var eventkeywordVal = document.getElementById('keyword').value;
        var eventlocationVal = document.getElementById('location').value;
        var eventFromVal = document.getElementById('from_date').value;
        var eventToVal = document.getElementById('to_date').value;

        var eventcategoryIndex = document.getElementById('category').selectedIndex;
        var eventcategoryVal = document.getElementById('category')[eventcategoryIndex].value;

        var eventUrl = "/eventresults.aspx?keyword="+ eventkeywordVal + "&location=" + eventlocationVal + "&from_date=" + eventFromVal + "&to_date=" + eventToVal + "&category=" + eventcategoryVal; // & "&genericid=" & strSQLWhere; 

        var GETDATA = new Array();

        // Get the string that follows the "?" in the window's location.
        var sGet = window.location.search;
        if (sGet) // if has a value...
        {
            // Drop the leading "?"
            sGet = sGet.substr(1);
            
            // Generate a string array of the name value pairs.
            // Each array element will have the form "foo=bar"
            var sNVPairs = sGet.split("&");
            
            // Now, for each name-value pair, we need to extract
            // the name and value.
            for (var i = 0; i < sNVPairs.length; i++)
            {
                // So, sNVPairs[i] contains the current element...
                // Split it at the equals sign.
                var sNV = sNVPairs[i].split("=");
                
                // Assign the pair to the GETDATA array.
                var sName = sNV[0];
                var sValue = sNV[1];
                GETDATA[sName] = sValue;
            }
        }

        eventUrl = eventUrl + "&page_num=1"
        window.parent.location.href = eventUrl;
    
    }
    
    return false;
}

 







