// JavaScript Document
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function setHeights(thepage){
	  var myHeight = 0;
	  var myWidth = 0;
	 if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
	myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
	myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
	myWidth = document.body.clientWidth;
  }

	  var theContainer = document.getElementById("contentDiv");
	  var theNavigationContainer = document.getElementById("navigationDiv");
	  var theLogo = document.getElementById("theLogo");
	 // var theNavigationBackground = document.getElementById("navigationTableBackground");
	  
	  
	  if(theNavigationContainer){
		theNavigationContainer.style.height = (myHeight-40+'px');  
		}
		
	  /*if(theNavigationBackground){
		  if(myHeight < 700){
			  theNavigationBackground.Background = "../images/JingDaoLogoLeft2.gif";
			  }else{
				theNavigationBackground.Background = "../images/JingDaoLogoLeft3.gif";  
				  }
		  }
	  */
	  if(theContainer){
		theContainer.style.height = (myHeight-50+'px');  
		  }
	 
	 /*
	 if(theLogo){
		  if (thepage == 2){
			  theLogo.height = myHeight-300;
			   //theLogo.height = myHeight-90;  
			   //alert('1-' + myWidth);
			   //thelogo.width = myWidth - 400;
			  }else{
				 theLogo.height = myHeight-190;
				 //alert('2-' + myWidth);
				 //thelogo.width = myWidth - 400;
				  }
		  
		  }
	 */
	  
}	

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function setTop(theImg, theName){
	var img1 = document.getElementById("imgni");
	var img2 = document.getElementById("imgke");
	var img3 = document.getElementById("imgge");
	var img4 = document.getElementById("imgpr");
	img1.src = "../images/buttons/home_nieuws_up.gif"
	img2.src = "../images/buttons/home_kennis_up.gif"
	img3.src = "../images/buttons/home_gezond_up.gif"
	img4.src = "../images/buttons/home_praktisch_up.gif"
	img1.oSrc = "../images/buttons/home_nieuws_up.gif"
	img2.oSrc = "../images/buttons/home_kennis_up.gif"
	img3.oSrc = "../images/buttons/home_gezond_up.gif"
	img4.oSrc = "../images/buttons/home_praktisch_up.gif"
		
	if(theImg.length > 0){	
		var imgToChange = document.getElementById(theImg);
		//alert(imgToChange.src);
		imgToChange.src = "../images/buttons/home_"+theName+"_over.gif";
		imgToChange.oSrc = "../images/buttons/home_"+theName+"_over.gif";
	}
}
function doOver(linknr, linkpos){
	var imagetoswitch = document.getElementById("toptd" + linknr);
	imagetoswitch.background = "../images/buttons/button_top_" + linkpos + "_over.gif";
	
	var linktoswitch = document.getElementById("link" + linknr);
	linktoswitch.style.color = "white";
	
	}
	
function doOut(linknr, linkpos){
	var tempActiveButton = parent.mainFrame.document.forms[0].activeButton.value
	if(linknr != tempActiveButton){
		var imagetoswitchback = document.getElementById("toptd" + linknr);
		imagetoswitchback.background = "../images/buttons/button_top_" + linkpos + "_up.gif";
		var linktoswitch = document.getElementById("link" + linknr);
		linktoswitch.style.color = "";
	}/**/
}

function doOverBottom(linknr, linkpos){
	var imagetoswitch = document.getElementById("toptd" + linknr);
	imagetoswitch.background = "../images/buttons/button_bottom_" + linkpos + "_over.gif";
	
	var linktoswitch = document.getElementById("link" + linknr);
	linktoswitch.style.color = "white";
	
	}
	
function doOutBottom(linknr, linkpos){
	var tempActiveButton = parent.mainFrame.document.forms[0].activeButton.value
	if(linknr != tempActiveButton){
		var imagetoswitchback = document.getElementById("toptd" + linknr);
		imagetoswitchback.background = "../images/buttons/button_bottom_" + linkpos + "_up.gif";
		var linktoswitch = document.getElementById("link" + linknr);
		linktoswitch.style.color = "";
	}/**/
}

function doOverLang(linknr, linkpos){
	var imagetoswitch = document.getElementById("langtd" + linknr);
	imagetoswitch.background = "../images/buttons/button_lang_over.gif";
	
	var linktoswitch = document.getElementById("langlink" + linknr);
	linktoswitch.style.color = "white";
	
	}
	
function doOutLang(linknr, linkpos){
	var tempActiveButton = parent.mainFrame.document.forms[0].currentLang.value
	var imagetoswitchback = document.getElementById("langtd" + linknr);
		imagetoswitchback.background = "../images/buttons/button_lang_up.gif";
	if(linknr != tempActiveButton){
		
		var linktoswitch = document.getElementById("langlink" + linknr);
		linktoswitch.style.color = "";
	}/*euh?*/
}
	
function doSimpleOver(linknr){
	var imagetoswitch = document.getElementById("lefttd" + linknr);
	imagetoswitch.background = "../images/buttons/button_left_over2.gif";
	var spantoswitch = document.getElementById("leftlinkspan" + linknr);
	spantoswitch.style.color = "#FFFFFF";
}

function doSimpleOut(linknr){
	var imagetoswitch = document.getElementById("lefttd" + linknr);
	imagetoswitch.background = "../images/buttons/button_left_up2.gif";
	var spantoswitch = document.getElementById("leftlinkspan" + linknr);
	spantoswitch.style.color = "#751517";
}
	
function initMenu(){
	parent.topFrame.window.location = 'topframe.asp?type=publiek';
	parent.bottomFrame.window.location = 'bottomframe.asp?type=publiek';
	/*
	parent.topFrame.window.location.reload();
	parent.bottomFrame.window.location.reload();
	parent.topFrame.doOut(1, 'left');
	parent.topFrame.doOut(2, 'center');
	parent.topFrame.doOut(3, 'center');
	parent.topFrame.doOut(4, 'center');
	parent.topFrame.doOut(5, 'right');*/
	
	}	
	
function setTopMember(){
	parent.topFrame.window.location = 'topframe.asp?type=leden';
	parent.bottomFrame.window.location = 'bottomframe.asp?type=leden';
}
	
function openWindow(url){
	window.open(url, '', '');
	}
	
function openWindowWithArgs(url, args){
	window.open(url, '', args);
	}	
	
	
