/**
 * @author jblomme
 */

window.onload = function() {
	fixMenu();
}

function fixMenu() {
	if (window.attachEvent) {
		/*var sfEls = document.getElementById("nav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}*/
        
        var ieULs = document.getElementById('nav').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);
            
            var ieMat = ieULs[j].firstChild;

            ieMat.style.width=ieULs[j].offsetWidth+"px";
            ieMat.style.height=ieULs[j].offsetHeight+"px";	
            ieULs[j].style.zIndex="99";
        }

        /** IE script to change class on mouseover **/
        var sfEls = document.getElementById("nav").getElementsByTagName("LI");
        for (var i=0; i<sfEls.length; i++) {
            sfEls[i].onmouseover=function() {
                this.className+=" sfhover";
            }
            
            sfEls[i].onmouseout=function() {
                this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
            }
        }
	}
}
//hannes
function toggle_visibility(id) {
   var e = document.getElementById(id);
   if(e.style.display == 'block')
      e.style.display = 'none';
   else
      e.style.display = 'block';
}
