// JavaScript Document

    // Preload image(s)
if (document.images) {

      	img1 = new Image(900,400); 
      	img1.src="<? echo $bgimg ?>";
		
      	img1 = new Image(900,200); 
      	img1.src="gfx/banner_200px.jpg";
		
		
}
 
	// JS dependent style definitions
document.write('<style>#transbox{display:none;}</style>');
document.write('<style>#formbox{display:none;}</style>');
document.write('<style>#nieuwsbox{display:none;}</style>');
document.write('<style>#bgphoto{visibility:hidden;}</style>');
	
	
	// Fade functions
window.onload = function() {initImage()}

function initImage() {
  setTimeout('showImg()', 5);
  setTimeout('showDiv("transbox")', 1000);
  imageId = 'bgphoto';
  image = document.getElementById(imageId);
  //image.style.visibility = 'visible';
  opacity(imageId, 0, 100, 1000);
}



function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //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 + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 
	
	function showImg(){
		var obj = document.getElementById('bgphoto');
		obj.style.visibility = 'visible';
	}

	function showDiv(id){
		var obj = document.getElementById(id);
		obj.style.display = 'block';
	}
	

	function rollover(ImageIndex,ImgName)
	{

	document.images[ImageIndex].src = ImgName;

	}
	
	
	
	<!-- Form validation
function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' dient een correct e-mailadres te bevatten.\n';

      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' dient een getal te bevattem.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is een verplicht veld.\n'; }
  } if (errors) alert('de volgende velden zijn niet of niet correct ingevuld:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
