// Ensure there is no conflict with any other
// JS library
jQuery.noConflict();

// When the DOM is ready
jQuery(document).ready(function(){
	// When a li is hovered over
	jQuery('li.contracted').hover(
		// Display the nested ul
		function() { jQuery('.submenu', this).css('display', 'block'); },
		function() { jQuery('.submenu', this).css('display', 'none'); });
	
	if (jQuery('div#sidecontacttopinner input#submit')) {	
		jQuery('div#sidecontacttopinner input#submit').hover(
			function() { jQuery(this).addClass('hover'); },
			function() { jQuery(this).removeClass('hover'); }
		);
	}
		
	startList('navbar');
});

function startList(nav) {
  if (document.all&&document.getElementById(nav)) {
    navRoot = document.getElementById(nav);
    for (i=0; i<navRoot.childNodes.length; i++) {
      node = navRoot.childNodes[i];
      if (node.nodeName=="LI") {
        node.onmouseover=function() {
          this.className+=" over";
          this.style.zIndex=200;
        }
        node.onmouseout=function() {
          this.className=this.className.replace(" over", "");
          this.style.zIndex=0;
        }
      }
    }
  }
}