//milliseconds
var slideShowSpeed = 5000

//seconds
var crossFadeDuration = 3

//image files
var Pic1 = new Array() 
Pic1[0] = 'images/content/img01.jpg'
Pic1[1] = 'images/content/img02.jpg'
Pic1[2] = 'images/content/img03.jpg'

var Pic2 = new Array() 
Pic2[0] = 'images/content/img04.jpg'
Pic2[1] = 'images/content/img05.jpg'
Pic2[2] = 'images/content/img06.jpg'

var Pic3 = new Array() 
Pic3[0] = 'images/content/img07.jpg'
Pic3[1] = 'images/content/img08.jpg'
Pic3[2] = 'images/content/img09.jpg'

var t
var j = 0
var p = Pic1.length

var preLoad1 = new Array()
var preLoad2 = new Array()
var preLoad3 = new Array()
for (i = 0; i < p; i++){
   preLoad1[i] = new Image()
   preLoad2[i] = new Image()
   preLoad3[i] = new Image()
   preLoad1[i].src = Pic1[i]
   preLoad2[i].src = Pic2[i]
   preLoad3[i].src = Pic3[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow1.style.filter="blendTrans(duration=2)"
      document.images.SlideShow1.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow1.filters.blendTrans.Apply()      
      document.images.SlideShow2.style.filter="blendTrans(duration=2)"
      document.images.SlideShow2.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow2.filters.blendTrans.Apply()      
      document.images.SlideShow3.style.filter="blendTrans(duration=2)"
      document.images.SlideShow3.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow3.filters.blendTrans.Apply()      
   }
   document.images.SlideShow1.src = preLoad1[j].src
   document.images.SlideShow2.src = preLoad2[j].src
   document.images.SlideShow3.src = preLoad3[j].src
   if (document.all){
      document.images.SlideShow1.filters.blendTrans.Play()
      document.images.SlideShow2.filters.blendTrans.Play()
      document.images.SlideShow3.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}

function validate_form() {
  validity = true; 
  if (!check_empty(document.form.taxatieadres.value))
        { validity = false; alert('U heeft geen object / taxatie adres ingevuld!'); }
  if (!check_email(document.form.email.value))
        { validity = false; alert('Het E-mail adres is ongeldig!'); }
  if (!check_empty(document.form.naam.value))
        { validity = false; alert('U heeft geen naam ingevuld!'); }
return validity;
}

function check_empty(text) {
  return (text.length > 0); // returns false if empty
}

function check_email(adres) {
  if ((adres == "")
    || (adres.indexOf ('@') == -1)
    || (adres.indexOf ('.') == -1))
      return false;
  return true;
}
function check_telefoon(nr1,nr2,nr3) {
  if ((nr1 == "") && (nr2  == "") && (nr3  == ""))
		{return false;}
  else
		{return true;}
}

function OpenWindow(URL, w, h){
	w = window.open(URL, '', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1 width=' + w + ',height=' + h);
}

function ShowFoto(map,nr) {
   w=window.open('','newwin','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=350,height=250');
   w.document.write('<html>');
   w.document.write('<head>');
   w.document.write('<title>Espo BV</title>');
   w.document.write('</head>');
   w.document.write('<body topmargin=0 leftmargin=0><img border=0 src=images/content/wat/'+map+'/'+nr+'g.jpg></body>');
   w.document.write('</html>');
   w.document.close();
}

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
{
	for(var i=0; i<document.images.length; i++)
	{
		var img = document.images[i];
		var imgName = img.src.toUpperCase();
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
		{
			var imgID = (img.id) ? "id='" + img.id + "' " : "";
			var imgClass = (img.className) ? "class='" + img.className + "' " : "";
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
			var imgStyle = "display:inline-block;" + img.style.cssText;
			if (img.align == "left") 
				imgStyle = "float:left;" + imgStyle;
			if (img.align == "right") 
				imgStyle = "float:right;" + imgStyle;
			if (img.parentElement.href) 
				imgStyle = "cursor:hand;" + imgStyle;
			var strNewHTML = "<span " + imgID + imgClass + imgTitle
			+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
			img.outerHTML = strNewHTML;
			i = i-1;
		}
	}
}
