var strAanbodStart = "<h1>Een selectie uit ons actuele aanbod</h1>";
var foto1 = 1;
var foto2 = 2;
var foto3 = 3;
var strCurrentItem;


function popUpItem(itemSource) {
  var w = 640, h = 480;
  var windowPopup;
  var winOpen=0;

  if (document.all || document.layers) {
    w = screen.availWidth;
    h = screen.availHeight;
  }

  var popW = 500, popH = 650;
  var leftPos = (w-popW)/2, topPos = (h-popH)/2;


  day = new Date();
  id = day.getTime();
  var windowProps = 'width='+popW+',height='+popH+',left='+leftPos+',top='+topPos+',toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=yes';
  var windowPopup = window.open('./popup.htm', id, windowProps );

  do {
    try {
      windowPopup.document.getElementById("contentPopUp").innerHTML = itemSource;  
      winOpen=1
    }
    catch(e) {
    }
  }
  while(winOpen==0);
}



function WriteMail() {
  document.write('<a href="mailto:Handelsonderneming%20Daniël%20Meijer%20<info@danielmeijer.nl>" class="Inhoud">info@danielmeijer.nl</a>');
}


function WisselFoto() {
  foto1++;
  if( foto1 == 5 ) { foto1 = 1 }
  foto2++;
  if( foto2 == 5 ) { foto2 = 1 }
  foto3++;
  if( foto3 == 5 ) { foto3 = 1 }


  document.all.WA1.filters.blendTrans.Apply();
  document.all.WA1.src = "img/wissel"+foto1+".jpg"
  document.all.WA1.filters.blendTrans.Play();

  document.all.WA2.filters.blendTrans.Apply();
  document.all.WA2.src = "img/wissel"+foto2+".jpg"
  document.all.WA2.filters.blendTrans.Play();

  document.all.WA3.filters.blendTrans.Apply();
  document.all.WA3.src = "img/wissel"+foto3+".jpg"
  document.all.WA3.filters.blendTrans.Play();

  window.setTimeout('WisselFoto()', 5000);
}



function showPage(ID) {
  document.getElementById("bodyIndex").style.display = "none";
  document.getElementById("bodyContact").style.display = "none";
  document.getElementById("bodyRoute").style.display = "none";
  document.getElementById("bodyAanbod").style.display = "none";

  document.getElementById(ID).style.display = "block";
  document.getElementById(ID).focus();
  
  // Laden aanbod
  if( ID == "bodyAanbod" ) {
    document.getElementById("bodyAanbod").innerHTML = strAanbodStart+strAanbod;
  }
}
