   var container = { 

      id   :"divContainer",  // the id of the box

      top  :50,         // vertically centered (percentage)

      left :50          // horizontally centered (percentage)

   };

      

   function deadCentreFeature(){ 



	  document.getElementById('divFoto').style.zIndex = 1;

	        

	  if (document.getElementById(container.id)) { 



         var elm = document.getElementById(container.id); 

         cWidth  = elm.offsetWidth; 

         cHeight = elm.offsetHeight; 



         if (self.innerHeight){ 

            width  = self.innerWidth; 

            wHeight = self.innerHeight; 

         } else if (document.documentElement && 

                    document.documentElement.clientHeight) { 

            wWidth  = document.documentElement.clientWidth; 

            wHeight = document.documentElement.clientHeight; 

         } else if (document.body) { 

            wWidth  = document.body.clientWidth; 

            wHeight = document.body.clientHeight; 

         } 



         cmLeft = wWidth  - cWidth  >= 0 ? 

         -Math.round((cWidth / (100/container.left)))  +"px" : 0; 



         cmTop  = wHeight - cHeight >= 0 ? 

         -Math.round((cHeight / (100/container.top ))) +"px" : 0; 



         elm.style.margin = cmTop + " 0 0 " + cmLeft; 

         elm.style.left   = cmLeft != 0 ? container.left + "%" : 0; 

         elm.style.top    = cmTop  != 0 ? container.top  + "%" : 0; 

      } 

   }  



   window.onload = function(){ 

     deadCentreFeature(); 

   } 

  window.onresize = function(){ 

    deadCentreFeature(); 

  }



function sluiten()

{

  id2 = currentItemDiv();

  opacity(id2, 0, 85, 100);

  document.getElementById(id2).style.zIndex = 0;  

}



function opacity(id, opacStart, opacEnd, millisec) {

	//speed for each frame



	var speed = Math.round(millisec / 100);

	var timer = 0;

	id2 = currentItemDiv();



	menuID = 'linkMenu' + id.slice(3, id.length);



	if (id2!="")

	{

	  menuID2 = 'linkMenu' + id2.slice(3, id2.length);

	  a = document.getElementById(menuID2);

	  if (a!=null)

        document.getElementById(menuID2).className = 'md3';

      else

	    alert('kan element ' + menuID2 + ' niet vinden!');

	}

	if (id2==id)

	  document.getElementById(menuID2).className = 'md3';

	else

      document.getElementById(menuID).className = 'md2';

	

	//determine the direction for the blending, if start and end are the same nothing happens

      if(opacStart < opacEnd) {

		for(i = opacStart; i <= opacEnd; i++)

			{

			setTimeout("changeOpac(" + i + "," + (opacEnd - i) + ",'" + id + "','" + id2 + "')",(timer * speed));

			if (i==opacEnd)

			  setTimeout("instellenBovenlaag()",(timer + 1 * speed));

			timer++;

		}

	}



	if (id2!="")

	{

	  document.getElementById(id2).style.zIndex = 1;

	  document.getElementById(id).style.zIndex = 10;

	} 

	else 

	  document.getElementById(id).style.zIndex = 10;

}



function instellenBovenlaag()

{

  if (currentItemDiv() == "")

	document.getElementById('divDummy').style.zIndex = 10;

}





//change the opacity for different browsers

function changeOpac(opacity, opacity2, id, id2) {

	var object = document.getElementById(id).style; 

	object.opacity = (opacity / 100);

	object.MozOpacity = (opacity / 100);

	object.KhtmlOpacity = (opacity / 100);

	object.filter = "alpha(opacity=" + opacity + ")";

	if (id2!="")

	{

	  var curObject = document.getElementById(id2).style;

	  curObject.opacity = opacity2 / 100;

	  curObject.MozOpacity = (opacity2 / 100);

	  curObject.KhtmlOpacity = (opacity2 / 100);

	  curObject.filter = "alpha(opacity=" + opacity2 + ")";

	}

}



function currentItemDiv()

{

	//welke div wordt getoond? Opacity > 0


	if (document.getElementById('divFoto').style.opacity > 0)

	  return 'divFoto';

	else if (document.getElementById('divBon').style.opacity > 0)

	  return 'divBon';

	else if (document.getElementById('divVacatures').style.opacity > 0)

	  return 'divVacatures';

	else if (document.getElementById('divActies').style.opacity > 0)

		  return 'divActies';

	//else if (document.getElementById('divOpkikker').style.opacity > 0)

	//  return 'divOpkikker';

	else if (document.getElementById('divLinks').style.opacity > 0)

	  return 'divLinks';

	else if (document.getElementById('divTeam').style.opacity > 0)

	  return 'divTeam';

	else if (document.getElementById('divOpeningstijden').style.opacity > 0)

	  return 'divOpeningstijden';

	else if (document.getElementById('divContact').style.opacity > 0)

	  return 'divContact';

	else if (document.getElementById('divDisclaimer').style.opacity > 0)

	  return 'divDisclaimer';

	else if (document.getElementById('divColofon').style.opacity > 0)

	  return 'divColofon';

	else if (document.getElementById('divSpaarkaart').style.opacity > 0)

	  return 'divSpaarkaart';

	else if (document.getElementById('divStudent').style.opacity > 0)

	  return 'divStudent';

	else if (document.getElementById('divWelkom').style.opacity > 0)

	  return 'divWelkom';

	else

	  return "";	

}



function shiftOpacity(id, millisec) { alert(id);

    //if an element is invisible, make it visible, else make it ivisible 

    if(document.getElementById(id).style.opacity == 0) { 

        opacity(id, 0, 85, millisec); 

    } else { 

        opacity(id, 85, 0, millisec); 

    } 

} 



// remove the registerOverlay call to disable the controlbar

hs.registerOverlay(

   	{

   		thumbnailId: null,

   		overlayId: 'controlbar',

   		position: 'top right',

   		hideOnMouseOut: true

	}

);

	

hs.graphicsDir = 'highslide/graphics/';

hs.outlineType = null;

hs.captionEval = 'this.thumb.title';



function load()

{

  //Tonen welkomspagina

  opacity('divWelkom', 0, 95, 100);

  //opacity('divLocatie', 0, 95, 1000);

}		 
