/** JavaScript **/
function getElementsById(id,readroot,theArray)
{
if (typeof readroot=="undefined" || readroot==null)
{
if (this.nodeType==9)
readroot=document.documentElement;
else readroot=this;
}
if (typeof theArray=="undefined" || theArray==null)
{theArray=new Array();}
var node=readroot.childNodes;
for (var i=0; i<node.length; i++)
{
if (typeof node[i].id!="undefined" &&
node[i].id==id) {theArray[theArray.length]=node[i];}
if (node[i].hasChildNodes())
{theArray=getElementsById(id,node[i],theArray);}
}
return theArray;
}
document.getElementsById=getElementsById;


ieHover = function() {
var allul=document.getElementsById('nav');
	
for (k=0; k<allul.length; k++){


var ieULs = allul[k].getElementsByTagName('ul');

/** IE script to cover <select> elements with <iframe>s **/
for (j=0; j<ieULs.length; j++) {
ieULs[j].innerHTML = ('<iframe src="about:blank" scrolling="no" frameborder="0"></iframe>' + ieULs[j].innerHTML);
/*ieULs[j].innerHTML = ('<iframe id="iePad' + j + '" src="about:blank" scrolling="no" frameborder="0" style=""></iframe>' + ieULs[j].innerHTML);
	var ieMat = document.getElementById('iePad' + j + '');*/
//	var ieMat = ieULs[j].childNodes[0];  alert(ieMat.nodeName); // also works...
	var ieMat = ieULs[j].firstChild;
		ieMat.style.width=ieULs[j].offsetWidth+"px";
		ieMat.style.height=ieULs[j].offsetHeight+"px";	
		ieULs[j].style.zIndex="99";
		ieULs[j].style.zIndex=(parseInt(ieULs[j].style.zIndex)+1).toString();
}
/** IE script to change class on mouseover **/
	var ieLIs = allul[k].getElementsByTagName('li');
	for (var i=0; i<ieLIs.length; i++) if (ieLIs[i]) {
		ieLIs[i].onmouseover=function() {this.className+=" iehover";}

	ieLIs[i].onmouseout=function() {this.className=this.className.replace(' iehover', '');}
	}} }
if (window.attachEvent) window.attachEvent('onload', ieHover);
/** end **/
