<!--//--><![CDATA[//><!--


var xiframes = new Array();
var oiframes = new Array();
var isOpera = /Opera/.test(navigator.userAgent);

sfHover = function() {
if (!isOpera){
	var sfEls = document.getElementById("main_navigation").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
			if(this.firstChild.className == "parent")	{
				show_div(this.id);
			}
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			if(this.firstChild.className == "parent")	{
				hide_div(this.id);
			}
		}
	}
	}
}


if (window.attachEvent) window.attachEvent("onload", sfHover);



function show_div(xdiv)	{
//	if(oiframes[0] != "")	{
//		hide_div(oiframes[0]);
//	}
	var myParent = document.getElementById(xdiv);
	var menuWidth = myParent.lastChild.offsetWidth;
	var menuHeight = myParent.lastChild.offsetHeight;
	var parentLeft = myParent.lastChild.offsetLeft;
	var parentTop = myParent.lastChild.offsetTop;
	var xiframe = document.createElement("iframe");
	var xiArrayLength = xiframes.length;
	xiframe.setAttribute("id", "xifone" + xiArrayLength);
	xiframe.setAttribute("frameborder", "0");
	myParent.appendChild(xiframe);
	//show_menu(xdiv);  function to show and position parent layer
	xiframe.style.width = menuWidth;
	xiframe.style.left = parentLeft;
	xiframe.style.top = parentTop;
	xiframe.style.zIndex = 2;
	xiframe.style.height = menuHeight;
	xiframe.style.position = "absolute";
	xiframes.push(xiframe);
	oiframes.push(xdiv);
}

function hide_div(xdiv) {
		var	myParent = document.getElementById(xdiv);
		// Find the correct element
		hidePos = findInArray(oiframes,xdiv);
		// hide the div and move it and delete the iframe;
		//	myParent.removeChild(document.getElementById("xifone"));
		if(hidePos == 0)	{
			xiframe = xiframes.shift();
			oiframe = oiframes.shift();
		}	else	{
			xiframe = xiframes.pop();
			oiframe = oiframe.pop();
		}
		document.getElementById(xdiv).removeChild(xiframe);
		//hide_menu(xdiv); // function to hide parent layer;
		}

function findInArray(theArray,theString)	{
	var thePos = -1;
	for(i=0;i<theArray.length;i++)	{
		if(theArray[i] == theString)	{
			thePos = i;
			break;
		}
	}
	return thePos;
}
//--><!]]>
