//////
// Random plaatjes script
var theImages = new Array() // do not change this

// Sensid: voer hier de namen van de bestanden in, in de map /achtergronden
theImages[0] = 'back.jpg'
theImages[1] = 'back2.jpg'
theImages[2] = 'back3.jpg'
theImages[3] = 'back4.jpg'
theImages[4] = 'back5.jpg'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="/images/achtergronden/'+theImages[whichImage]+'" id="bg" />');
}

////////
// in- en uitklap script
var old = 0;
function changeindex(id){
	if(old != 0 && old != 2 && old != 3 && old != 4){
		Effect.toggle('item'+old, 'slide',{duration: 0.3});
		Effect.toggle('introtext'+old, 'slide',{duration: 0.3});
//		document.getElementById('title'+old).style.color = '#b5b7b8'; // kleur normaal
	}
	if(old == id){
		old = 0;
	}else{
		old = id;
//		document.getElementById('title'+id).style.color = '#b5b7b8'; // kleur actief
	}
		
	Effect.toggle('item'+id, 'slide',{duration: 0.3});
	Effect.toggle('introtext'+id, 'slide',{duration: 0.3});
}

// functie om alleen huidige item in- en uit te klappen; actieve (vorige) item klapt niet in
function changeindexCurrent(id){
//	if(old != 0){
//		Effect.toggle('item'+old, 'slide',{duration: 0.3});
//		Effect.toggle('introtext'+old, 'slide',{duration: 0.3});
//		document.getElementById('title'+old).style.color = '#b5b7b8'; // kleur normaal
//	}
	if(old == id){
		old = 0;
	}else{
		old = id;
//		document.getElementById('title'+id).style.color = '#b5b7b8'; // kleur actief
	}
		
	Effect.toggle('item'+id, 'slide',{duration: 0.3});
	Effect.toggle('introtext'+id, 'slide',{duration: 0.3});
}

////////
// Dreamweaver formulier controle script (met NL vertaling Basten)
function MM_validateForm() { //v4.0
  if (document.getElementById){
    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=document.getElementById(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+' bevat geen geldig e-mail adres.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) 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('Let op:\n'+errors);
    document.MM_returnValue = (errors == '');
} }

