OnLoadIEBugs = function()
{
  var menuID = "ptMainMenuNav"; //change this to appropriate id if neeeded
  IEhoverBug(menuID);
  selectHide(menuID);
  //add other dropdown menues if needed
  /*
  var otherMenuID = "ptMainMenuNav"; //change this to appropriate id if neeeded
  IEhoverBug(otherMenuID);
  selectHide(otherMenuID);
  */
}

/**************************************
/kindly taken from http://www.alistapart.com/articles/dropdowns and modified
/adds over class to appropriate classe, as IE doesnt support li:hover
/**************************************/


startList = function() {

if (!browserIsIE())
return;

	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("ptMainMenuNav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI" || node.nodeName=="li") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;





// *************************
/** IE script to cover <select> elements with <iframe>s **/
function selectHide(menuID)
{
  if(!browserIsIE())  //if not Internet explorer which is the only browser where the problem occurs
    return false;     //then do nothing
    
  var ieULs = document.getElementById(menuID).getElementsByTagName('ul');// id MUST correspond to id in xslt!

  for (j=0; j<ieULs.length; j++)
  {
    //insert iframe to hide select dropdowns
    ieULs[j].innerHTML = (ieULs[j].innerHTML + '<div></div><iframe name="IEBugHider" title="IEBugHider" style="filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)" class="iFrameHider" src="about:blank" scrolling="no" frameborder="0"></iframe>');
    var ieMat = ieULs[j].lastChild; //select iFrame in each UL
    ieMat.style.height = ieULs[j].offsetHeight + "px";
  }
}

/*--------------------------------------------------*/
//Internet explorer detect
function browserIsIE()
{
  var detect = navigator.userAgent.toLowerCase();
  if (checkIt('msie'))
    return true;  
  return false;
  
  function checkIt(string)
  {
	  if ((detect.indexOf(string) + 1) && !(detect.indexOf('opera') + 1)) //hvis msie og ikke opera!!! :-)
	    return true;
	  return false;
  }
}



