﻿//alert("main.js");
//if (window.attachEvent) alert("window.attachEvent");

var blnDOM = false, blnIE4 = false, blnNN4 = false;
if (document.layers) blnNN4 = true;
else if (document.all) blnIE4 = true;
else if (document.getElementById) blnDOM = true;


/* ------------------------------------------------ */
/* Images preloaden */
/* ------------------------------------------------ */
if (document.images) {
/*
  up_on = new Image(42,44);
  up_on.src = "./images/navigatie/up_on.gif";
*/
}


/* ------------------------------------------------ */
// dogetHeight // not needed anymore thanks to CSS-shim-trick
/* ------------------------------------------------ */
//function dogetHeight(){
//  //if(document.documentElement.clientHeight){
//  //alert(document.getElementById("container").offsetHeight);
//	
//  if(document.documentElement.clientHeight > document.getElementById("container").offsetHeight){
//	  heel = document.documentElement.clientHeight - document.getElementById("container").offsetHeight;
//	  half_a = heel/2;
//	  half = Math.floor(half_a);
//	
//	  document.getElementById("container").style.borderTop = "solid "+half+"px white";
//  }
//}



/* ------------------------------------------------ */
// sfHover
/* ------------------------------------------------ */
sfHover = function() {
	if(document.getElementById("container") && document.getElementById("container").getElementsByTagName("div"))
	{
	    var sfEls = document.getElementById("container").getElementsByTagName("div");
	    for (var i=0; i<sfEls.length; i++) {
		    sfEls[i].onmouseover=function() {
			    if ((this.className == "item") || (this.className == "filmitem") || (this.className == "theateritem") || (this.className == "muziekitem") || (this.className == "jeugditem")){
    				
				    this.className+="sfhover";
    				
			    }
		    }
		    sfEls[i].onmouseout=function() {
			    if ((this.className == "itemsfhover") || (this.className == "filmitemsfhover") || (this.className == "theateritemsfhover") || (this.className == "muziekitemsfhover") || (this.className == "jeugditemsfhover")){
    				
				    this.className=this.className.replace(new RegExp("sfhover\\b"), "");
			    }
		    }
	    }
    }
    
    if(document.getElementById("nav") && document.getElementById("nav").getElementsByTagName("li"))
    {
	    var sfElsz = document.getElementById("nav").getElementsByTagName("li");
	    for (var i=0; i<sfElsz.length; i++) {
		    sfElsz[i].onmouseover=function() {
			    if (this.className == "Level1 oclParentLI"){
				    this.className+=" sfhover";
			    }
		    }
		    sfElsz[i].onmouseout=function() {
			    if (this.className == "Level1 oclParentLI sfhover"){
				    this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			    }
		    }
	    }
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

/*
function dodingetje() {
  var sucker = document.getElementById("nav").getElementsByTagName("li");
  for (var i=0; i<sucker.length; i++) {
    
    if(sucker[i].childNodes.length > 1){
        alert(sucker[i].id);
    }
  }
}
*/

/* ------------------------------------------------ */
// doSwapUls(elem)
/* ------------------------------------------------ */
function doSwapUls(elem) {
	wie = document.getElementById(elem);

		if ((wie.style.display == 'none') || (wie.style.display == '')){
			wie.style.display = 'block';
		}else {
			wie.style.display = 'none';
		}
	//}
	
}


/* ------------------------------------------------ */
/* ignore Google AutoFill style */
/* ------------------------------------------------ */
if(window.attachEvent) window.attachEvent("onload", ignoreGoogleAutoFillStyle);
function ignoreGoogleAutoFillStyle(){
  inputList = document.getElementsByTagName("INPUT");
  for(i=0;i<inputList.length;i++){
    inputList[i].attachEvent("onpropertychange", restoreStyles);
    inputList[i].style.backgroundColor = "";
  }
  selectList = document.getElementsByTagName("SELECT");
  for(i=0;i<selectList.length;i++){
    selectList[i].attachEvent("onpropertychange", restoreStyles);
    selectList[i].style.backgroundColor = "";
  }
}
function restoreStyles(){
  if(event.srcElement.style.backgroundColor != "")
    event.srcElement.style.backgroundColor = "";
}
