// -----------------------------------------------------------------------------
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_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_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_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];}
}

var currentObj;

function swap(obj, state) {
  if (state != "") {
    if (state == 2) {
      obj.src = "/_images/" + obj.name + "_o.gif";
    } else if (state == 1) {
      obj.src = "/_images/" + obj.name + ".gif";
    }
    if (currentObj != null) {
      currentObj.src = "/_images/" + currentObj.name + "_o.gif";
    }
  }
}

// -----------------------------------------------------------------------------

var image = null;
 
function ShowFoto(etage, image) {
  var inner = "<img src=\"../_images/"+image+"\" id=\"overlayImg\" onclick=\"HideFoto();\" align=\"center\"/>";
  document.getElementById("showfoto").innerHTML = inner;

  var divwidth    = document.getElementById("overlayImg").width;
  var divheight   = document.getElementById("overlayImg").height;
  var width       = document.body.clientWidth;
  var height      = document.body.clientHeight + document.body.scrollTop;
  var marginleft  = (width - divwidth) / 2;
  if (etage == 0) {
    var margintop   = 650; //(height - divheight) /2;
  } else if (etage == 1) {
    var margintop   = 1000;//(height - divheight) /2;
  }

  var bodywidth   = document.body.scrollWidth;
  var bodyheight  = document.body.scrollHeight;
 
  document.getElementById("a_overlay").style.width  = bodywidth;
  if (height > bodyheight) {
    document.getElementById("a_overlay").style.height = height;
  }
  else document.getElementById("a_overlay").style.height = bodyheight;
 
  document.getElementById("showfoto").style.width  = divwidth;
  document.getElementById("showfoto").style.height = divheight;
  document.getElementById("showfoto").style.top    = margintop + (document.body.scrollTop / 2);
  document.getElementById("showfoto").style.left   = (width / 2) - 330; //marginleft;
  
  document.getElementById("showfoto").style.display  = "block";
  document.getElementById("a_overlay").style.display  = "block";
}
 
//------------------------------------------------------------------------------
function HideFoto() {
  document.getElementById("showfoto").style.display  = "none";
  document.getElementById("a_overlay").style.display  = "none";
}

// -----------------------------------------------------------------------------

<!--

function random_sfeer(){
  var sfeer1=new Array()
  //Headerplaatjes
  sfeer1[1]="/_images/sfeer/1.gif"
  sfeer1[2]="/_images/sfeer/2.gif"
  sfeer1[3]="/_images/sfeer/3.gif"
  sfeer1[4]="/_images/sfeer/4.gif"
  sfeer1[5]="/_images/sfeer/5.gif"

  //Linkerkolom
  var sfeer2=new Array()
  sfeer2[1]="/_images/sfeer/6.gif"
  sfeer2[2]="/_images/sfeer/7.gif"
  sfeer2[3]="/_images/sfeer/8.gif"
  sfeer2[4]="/_images/sfeer/9.gif"
  sfeer2[5]="/_images/sfeer/10.gif"

  
  //Linkerkolom
  var sfeer3=new Array()
 sfeer3[1]="/_images/sfeer/11.gif"
 sfeer3[2]="/_images/sfeer/12.gif"
 sfeer3[3]="/_images/sfeer/13.gif"
 sfeer3[4]="/_images/sfeer/14.gif"
 sfeer3[5]="/_images/sfeer/15.gif"

  
  var ry=Math.floor(Math.random()*sfeer1.length)

  if (ry==0)
     ry=1
     document.write('<img src="'+sfeer1[ry]+'" width="127" height="116" class="picture">');
	 document.write('<img src="'+sfeer2[ry]+'" width="127" height="116" class="picture">');
	 document.write('<img src="'+sfeer3[ry]+'" width="127" height="116" class="picture">');
	 }


//-------------------------------------------------------------------------------------------//

function random_headsfeer(){
  var sfeer1=new Array()
  //Headerplaatjes
  sfeer1[1]="/_images/sfeer/head/1.gif"
  sfeer1[2]="/_images/sfeer/head/2.gif"
  sfeer1[3]="/_images/sfeer/head/3.gif"
  sfeer1[4]="/_images/sfeer/head/4.gif"
  sfeer1[5]="/_images/sfeer/head/5.gif"
  sfeer1[6]="/_images/sfeer/head/6.gif"
  sfeer1[7]="/_images/sfeer/head/7.gif"
  sfeer1[8]="/_images/sfeer/head/8.gif"
  sfeer1[9]="/_images/sfeer/head/9.gif"
 
  var ry=Math.floor(Math.random()*sfeer1.length)

  if (ry==0)
     ry=1
     document.write('<img src="'+sfeer1[ry]+'" width="168" height="164" alt="Oudshoorn &amp; Van Egmond">');
	 }
	 
	 
//-------------------------------------------------------------------------------------------//
	 
var image = null;

function ShowFoto(image)
{
  var divwidth    = 600;
  var divheight   = 470;
  var width       = document.body.clientWidth;
  var height      = document.body.clientHeight + document.body.scrollTop;
  var marginleft  = (width - divwidth) / 2;
  var margintop   = (height - divheight) /2;
  var bodywidth	  = document.body.scrollWidth;
  var bodyheight  = document.body.scrollHeight;

  document.getElementById("a_overlay").style.width  = bodywidth;
  if (height > bodyheight)
  {
    document.getElementById("a_overlay").style.height = height;
  }
  else document.getElementById("a_overlay").style.height = bodyheight;

  document.getElementById("showfoto").style.width  = divwidth;
  document.getElementById("showfoto").style.height = divheight;
  document.getElementById("showfoto").style.top    = margintop + (document.body.scrollTop / 2);
  document.getElementById("showfoto").style.left   = marginleft;
  
  var inner = "<img src=\ "+image+"\ onclick=\"HideFoto();\" /><br /><span class=\"sluitfoto\">Klik op de foto om deze af te sluiten</span>"

  document.getElementById("showfoto").innerHTML = inner;
  
  document.getElementById("showfoto").style.display  = "block";
  document.getElementById("a_overlay").style.display  = "block";
}

function HideFoto()
{
  document.getElementById("showfoto").style.display  = "none";
  document.getElementById("a_overlay").style.display  = "none";
}

// Functie om het e-mailadres te verbergen
function hiddenMail() {
  document.getElementById("mail").href = "mailto:info@oudshoornenvanegmond.nl";
  return false;
}

//-->
