

$(function () {
	$("div.mainnavitem, li.subnavigation").hover(
		function () {
			if (menuObj != null && menuObj.attr("id") != $(this).attr("id")) {
				removeHover();
				menuObj = null;
			} else if (menuObj != null) {
				clearTimeout(timer);
			}
			if (!jQuery.support.cssFloat) $(this).find("div.subnav").slideDown(200);
			else $(this).find("div.subnav").fadeIn(200);
		},
		function () {
			menuObj = $(this);
			timer = setTimeout("removeHover()", 100);
		});	
	$("div.subnavitem").hover(
		function () {
			if (menuObj2 != null && menuObj2.attr("id") != $(this).attr("id")) {
				removeHover2();
				menuObj2 = null;
			} else if (menuObj2 != null) {
				clearTimeout(timer2);
			}
			if (!jQuery.support.cssFloat) $(this).find("div.subsubnav").slideDown(200);
			else $(this).find("div.subsubnav").fadeIn(200);
		},
		function () {
			menuObj2 = $(this);
			timer2 = setTimeout("removeHover2()", 100);
		});			
});
			
//MAIN NAV ROLLOVERS
var menuObj = null;
var menuObj2 = null;
var timer;   
var timer2;     
function removeHover() {
    if (menuObj) {
        menuObj.find("div.subnav").queue(
            function() { 
                $(this).hide(); 
                $(this).dequeue(); 
            });
    }
}
function removeHover2() {
    if (menuObj2) {
        menuObj2.find("div.subsubnav").queue(
            function() { 
                $(this).hide(); 
                $(this).dequeue(); 
            });
    }
}
/*
var active = '';

function showMenuC(e, src) {
	cancelHide();
   if (active != '') {
   	hideMenuC(active);
   }
	active = src;
	popup = document.getElementById(src);
	popup.style.visibility = "visible"
}

function delayHide() {
	timer = setTimeout('hideMenuC("'+active+'")', 1000);
}

function hideMenuC(src) {
	(document.getElementById(src)).style.visibility = "hidden";
}

function cancelHide() {
	if (window.timer) clearTimeout(timer);
}

*/
function openWin(URL, w, h) {
	aWindow = window.open(URL,"Window","scrollbars=no,resizable=no,width="+w+",height="+h);
}

function check() {
	element = document.getElementById('prodOpt');
	if (element.type != "hidden") {
		ndx = element.selectedIndex;
		if (ndx == 0) {
			alert("Please select an option");
			return false;
		} else if (element.options[ndx].value == 0) {
			alert("The item you ordered is temporarily out of stock");
			return false;
		}
	}
	return true;
}

