// Tog More for Search
function togMore(sShow)
{
	if (sShow == "hide")
	{
		document.getElementById("srchMoreId").style.display = "none";
	}
	else
	{
		document.getElementById("srchMoreId").style.display = "block";
	}
	return false;
}

//New Footer Js
function togFootMore(sShow)
{
	if (sShow == "hide")
	{
		document.getElementById("srchFootMoreId").style.display = "none";
	}
	else
	{
		document.getElementById("srchFootMoreId").style.display = "block";
	}
	return false;
}

String.prototype.trim1 = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

function srchFooterSub(ref){
  var frm=p_o("searchFooter");
  var queryval = frm.footQuery.value.trim1();
  queryval = queryval.replace( /\+/, " ");
  if(ref == 'a'){
   var newurl = frm.action + queryval;
     if (frm.target == '_blank') {
        window.open(newurl, '_blank', '');
      } else {
        window.location = newurl;
      }
  }else{
  var newurl = ref.href + queryval;
  window.location = newurl;
 }
  return false;
}

function searchFooterTarget(url, newWindow, newTarget) {
    // Set the target for the form
    document.bb_topform1.action = url;
    if (newWindow) {
        document.bb_topform1.target = '_blank';
    } else {
        document.bb_topform1.target = '';
    }

    // Update the tabs classes to allow highlighting of the selected
    var tabList = ["searchFootTabNews","searchFootTabWeb","searchFootTabImages","searchFootTabVideo","searchFootTabLocal"]
    for(var i=0;i<tabList.length;i++){
    document.getElementById(tabList[i]).className = '';
    }
    document.getElementById(newTarget).className = 'srchCatBg';

    return false;
}

function submitFooterSearch(event) {
    if (event == "onclick" || eventIsEnterKey(event)) {
        return srchFooterSub("a");        
    } else {
        return true;
    }
}
