/* IE Select box fix */
function toggleSelectBox(ID,show) {
	// ID = the id of the dropdown element DIV (or UL)
	// show = boolean value to show or hide the dropdown
	if(!document.getElementById("boxHide")) {
		// create the iframe if it doesn't already exist
		var boxHideIframe = document.createElement("iframe");
		boxHideIframe.setAttribute("id","boxHide");
		boxHideIframe.setAttribute("src","about:blank");
		boxHideIframe.setAttribute("scrolling","no");
		boxHideIframe.setAttribute("frameBorder","0");
		boxHideIframe.style.display = "none";
		boxHideIframe.style.position = "absolute";
		boxHideIframe.style.top = "0";
		boxHideIframe.style.left = "0";
		boxHideIframe.style.zIndex = "1";
		document.body.appendChild(boxHideIframe);
	}

	var iframe = document.getElementById("boxHide");
	
	if(ID) {
		var subnavmenu = ID;
		// show or hide
		iframe.style.display = (!show) ? "block" : "none";
		
		if(!show) {
			// set values of iframe to be same as subnav element (these are IE specific)
			iframe.style.top = subnavmenu.currentStyle['top'];
			iframe.style.left = subnavmenu.currentStyle['left'];
			iframe.style.width = subnavmenu.offsetWidth;
			iframe.style.height = subnavmenu.offsetHeight;
		}
	}

}
/* IE Select box fix */
var subNavTimer;
var open;
var isClosing;
$(document).ready(function(){
	isClosing = false;
    $("#dropnav > li").hover(
        function(){
        	
        	if($("ul.subdrop",this).is(":animated"))
        		return false;
        	
        	$("#dropnav > li ul.subdrop").fadeOut("fast");
			$("ul", this).slideDown("fast");
        }, 
        function() {
        	isClosing = true;
        	open = $(this);
        	subNavTimer = setTimeout('$("ul.subdrop", open).fadeOut("fast", function() { isClosing = false; open = false; });',200);
        } 
    );
    
    
});

