// JavaScript Document
$(document).ready(function() {
	
	
	/*$(".menu1").prepend("<span></span>"); //Throws an empty span tag right before the a tag
	
	$(".menu1").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the a tag
		$(this).find("span").show().html(linkText); //Add the text in the span tag
	}); 
	
	$(".menu1").hover(function() {	//On hover...
		$(this).find("span").stop().animate({ 
			marginTop: "-40" //Find the span tag and move it up 40 pixels
		}, 250);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0" //Move the span back to its original state (0px)
		}, 250);
	});*/
	

/*$('ul#topnav ul').hide(0.000000000000000000000000000000000000001);
$('ul#topnav li a').addClass('nav_parent');
$('ul#topnav ul a').removeClass('nav_parent');
$('ul#topnav ul a').addClass('nav_child');

$('.nav_parent').bind('mouseenter', function() {
	if (($(this).next().is('ul')) && ($(this).next().is(':visible'))) {
	return false;
	} else if (($(this).next().is('ul')) && ($(this).next().is(':hidden'))) {
	$(this).next().show();
	return false;
	}
});
	
$('.nav_parent').parent().bind('mouseleave', function() {
	$('ul#topnav ul:visible').hide();
});
*/

//$(" #topnav ul ").css({display: "none"}); // Opera Fix
$("#topnav li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});

	
});

sfHover = function() {
	var sfEls = document.getElementById("topnav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

