var Menus = {
  initialize : function(tabsElement) {
    if (document.all&&document.getElementById) {
      navRoot = tabsElement ? tabsElement : document.getElementById("tabs");
	  if (navRoot.childNodes)
		  for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
			  node.onmouseover=function() {
				this.className+=" over";
			  }
			  node.onmouseout=function() {
				  this.className=this.className.replace(" over", "");
				}
			}
		  }
    }
  }
}

function SearchSubmit(query) {
  window.location = '/search.html?q=' + query;
}

function SearchOnEnter(e,query) {
  var characterCode

  if(e && e.which) { //if which property of event object is supported (NN4)
    e = e;
    characterCode = e.which; //character code is contained in NN4's which property
  } else{
    e = event
    characterCode = e.keyCode;
  }

  if(characterCode == 13) { //if generated character code is equal to ascii 13 (if enter key)
    SearchSubmit(query);
  }
  return true;
}
