// JavaScript Document

/*
startList = function() {
if (document.all&&document.getElementById) {
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";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;
*/
$(function() {
	//drop_down('#nav');
	$('#nav li').hover(
		function() {
			$('ul:first', this).show();
		},
		function() {
			$('ul:first', this).hide();	
		});
});

function drop_down(obj) {
	for (i=0; i<$(obj +' > *').length; i++) {
		//console.log($('#nav').children()[i]);
		node = $(obj).children()[i];
		if (node.nodeName == 'LI')	 {
			$(node).mouseover(
				function() {
					//$(this).addClass('over');
					//console.log($(this));
					//$(this, 'ul:first').show();
					$('ul', this).css('display', 'block');
					
					//$(this, 'ul > li').css('display', 'block');
					//#nav li:hover ul, #nav li.over ul { display: block; } /* The magic */
				}).mouseout(
				function() {
					//$(this).removeClass('over');
					$('ul:first', this).css('display', 'none');
				});
		}
	}
	
}