﻿sfHover = function() {
	var ieNavs = document.getElementById("tnav").getElementsByTagName('ul');
	for(i=0; i<ieNavs.length; i++) {
		var ul = ieNavs[i];
		setHover(ul);
	}
}

function setHover(nav) {
	var ieULs = nav.getElementsByTagName('ul');
	for (j=0; j<ieULs.length; j++) {
		var ieMat=document.createElement('iframe');
		ieMat.src="javascript:false";
		ieMat.scrolling="no";
		ieMat.frameBorder="0";
		ieMat.style.width=ieULs[j].offsetWidth+"px";
		ieMat.style.height=ieULs[j].offsetHeight+"px";
		ieMat.style.zIndex="-1";
		ieULs[j].insertBefore(ieMat, ieULs[j].childNodes[0]);
		ieULs[j].style.zIndex="101";
	}
	var ieLIs = nav.getElementsByTagName('li');
	for (var i=0; i<ieLIs.length; i++) if (ieLIs[i]) {
		ieLIs[i].onmouseover=function() {
			if(!/\bsfhover\b/.test(this.className))
				this.className+=" sfhover";
		}
		ieLIs[i].onmouseout=function() {
			if(!this.contains(event.toElement))
				this.className=this.className.replace(' sfhover', '');
		}
	}
}

if (navigator.userAgent.toUpperCase().indexOf('MSIE 6.') != -1 && window.attachEvent)
	window.attachEvent('onload', sfHover);