function SubmitFormForSearch(){
    if(typeof(document.getElementById("ddholder"))  !== 'undefined' && document.getElementById("ddholder") != null ){
       {var v1=document.getElementById(qtClientID).value;var v3=document.getElementById(styleClientID).value;var v2=document.getElementById(ddholderClientID).options[document.getElementById(ddholderClientID).selectedIndex].value;var url='http://search.ca.com/search/ca?style='+v3+'&qt='+v1+'&col='+v2;window.location.href=ur;}
    }
    else{
            var v1=document.getElementById(qtClientID).value;
            
            //coveo search call - db
            var u1 = location.href;
            u1=u1.replace(location.search, '');
            u1= u1.replace(location.protocol + '//' + location.hostname, '');
            var parseurl = u1.split('/');
            var xlocale = '';

            for( x=0; x < parseurl.length; x++){
                if(parseurl[x].length== 2){
                    xlocale = xlocale + '/' + parseurl[x];
                }       
            }  
            
            var url2= location.protocol + '//' + location.hostname + xlocale +  '/search/?q=' + v1 + '&sk=ca.com'; //&culture=' + culture;
            var whereami = location.href;
            var findme = whereami.indexOf("search");
            if(findme <=0 ) {//already in search dont change the backurl
             url2 += '&backUrl=' + encodeURIComponent(location.href)
            }//if findme
            else{//get the value of the back and ur and use that
                var searchString = document.location.search;
                // strip off the leading '?'
                searchString = searchString.substring(1);
                var nvPairs = searchString.split("&");
                for (i = 0; i < nvPairs.length; i++){
                     var nvPair = nvPairs[i].split("=");
                     var name = nvPair[0];
                     var value = nvPair[1];
                     var findbackurl = name.indexOf("backUrl");
                     if ((name.indexOf("backURL") > -1) || (name.indexOf("backUrl") > -1)){
                        url2 += '&backUrl=' + value;
                     }//if name
                }//for i
            } //else if
            //end coveo search call
        window.location.href=url2;
    }
}

function getKeyCode(event,btnID)
{if(document.all)
{if(window.event)
{if(window.event.keyCode==13)
GetWindowSubmitEvent(event,btnID);}
else
{if(event.keyCode==13)
GetEventSubmitEvent(event,btnID);}
return false;}
else if(document.getElementById)
{if(window.event)
{if(window.event.keyCode==13)
GetWindowSubmitEvent(event,btnID);}
else
{if(event.keyCode==13)
GetEventSubmitEvent(event,btnID);}
return false;}
else if(document.layers)
{if(window.event)
{if(window.event.keyCode==13)
GetWindowSubmitEvent(event,btnID);}
else
{if(event.keyCode==13)
GetEventSubmitEvent(event,btnID);}
return false;}
return false;}
function GetWindowSubmitEvent(event,btnID)
{var btn=btnID.id;window.event.cancelBubble=true;window.event.returnValue=false;window.event.cancel=true;document.getElementById(btn).click();return false;}
function GetEventSubmitEvent(event,btnID)
{var btn=btnID.id;event.cancelBubble=true;event.returnValue=false;event.preventDefault();event.cancel=true;document.getElementById(btn).click();return false;}
