/*	
	asyncRequest('GET', 'step'+stepNr+'.php'+postString, function(o) 
	  { 
		scroller = false;
		get('configDiv').innerHTML = "<div id='configDivContent'>"+o.responseText+"</div>"; 
		get('configDivContent').style.visibility = 'hidden';
		setStepValue(stepNr);
		animateConfig();
		animateTitle();
	  });
*/




/////////////////////////////////////////////////////////////////////
// DIVERSE FUNCTIES
/////////////////////////////////////////////////////////////////////
if (self.innerHeight){	
	winW=self.innerWidth;
	winH=self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight){	// Explorer 6 Strict Mode
	winW=document.documentElement.clientWidth;
	winH=document.documentElement.clientHeight;
} else if (document.body){ 
	winW=document.body.clientWidth;
	winH=document.body.clientHeight;
}


function get(el) {
  return document.getElementById(el);
}


function fadeRotatorBannerIn()
{
	fadeRotatorBanner = new Animation({
	  from: 0,
	  to: 100,
	  tweenType: 'fast',
	  ontween: function animate(value){ 
	  	transitionOpacityIn('rotator'+imageRotatorNr+'div',value);
	  },
	  oncomplete: function() { 
			t=setTimeout("fadeRotatorBannerOut()", 5000);
		}	  
	});		
	fadeRotatorBanner.start();
}
function fadeRotatorBannerOut()
{
	clearTimeout(t);
	fadeRotatorBanner = new Animation({
	  from: 100,
	  to: 0,
	  tweenType: 'fast',
	  ontween: function animate(value){ 
	  	transitionOpacityOut('rotator'+imageRotatorNr+'div',value);
	  },
	  oncomplete: function() { 
	  			imageRotatorNr++;
				if(imageRotatorNr>NrOfRotatorImages){
					imageRotatorNr=1;
				}
				fadeRotatorBannerIn();
				}	  
	});		
	fadeRotatorBanner.start();
}


function slidePhotoGallery(pageNumber)
{
	get("photoPaging"+imagePageNr).className = 'newsOverviewPaging';
	get("photoPaging"+pageNumber).className = 'newsOverviewPagingSelected';
	imagePageNr = pageNumber;
	get('photoDiv').style.left = 0-((pageNumber*484)-484)+"px";
}

function slidePressGallery(pageNumber)
{
	get("pressPaging"+pressPageNr).className = 'newsOverviewPaging';
	get("pressPaging"+pageNumber).className = 'newsOverviewPagingSelected';
	pressPageNr = pageNumber;
	get('pressDiv').style.left = 0-((pageNumber*140)-140)+"px";
}
function slideVideoGallery(pageNumber)
{
	get("videoPaging"+videoPageNr).className = 'newsOverviewPaging';
	get("videoPaging"+pageNumber).className = 'newsOverviewPagingSelected';
	videoPageNr = pageNumber;
	get('videoDiv').style.left = 0-((pageNumber*480)-480)+"px";
}



currentLightBoxImage = 1;
nrOfLightBoxImages = 0;

function displayLightBox(imgNr,nrOfImages)
{
	
	//scrollHeight = (document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);
	currentLightBoxImage = imgNr;
	nrOfLightBoxImages = nrOfImages;
	/*
	get("bgDiv").style.height = (get("webSite").offsetHeight)+'px';
	animBg = new Animation({
	  from: 60,
	  to: 70,
	  tweenType: 'fast',
	  ontween: function animate(value){ transitionOpacityIn('bgDiv',value);},
	  oncomplete: function() { }	  
	});		
	animBg.start();	
	*/
	imageSRC = get("photo"+currentLightBoxImage).src;
	var t = new Image();
    t.imageSRC = (get("photo"+currentLightBoxImage).getAttribute ?get("photo"+currentLightBoxImage).getAttribute("src") : false) || get("photo"+currentLightBoxImage).src;
	get("overlayDiv").innerHTML = '<div id="closeButton"><a href="#" onclick="closeOverlay();this.blur();return false;"><img src="'+siteURL+'template/img/closebutton.jpg" border="0" /></a></div><img id="largeImage" src="'+imageSRC+'" border="0" /><div id="lightBoxMenu"><a href="#" id="propImagePrev" onclick="lightBoxPrev();this.blur();return false">< previous</a><div id="propImageNr">image '+currentLightBoxImage+' of '+nrOfLightBoxImages+'</div><a id="propImageNext" href="#" onclick="lightBoxNext();this.blur();return false">next ></a></div>';
	get("overlayDiv").style.display = '';
	if(typeof get("photo"+currentLightBoxImage).naturalWidth == "undefined"){
		imageWidth =  get("largeImage").offsetWidth;
		imageHeight =  get("largeImage").offsetHeight;
	} else {
		imageWidth =  get("photo"+currentLightBoxImage).naturalWidth;
		imageHeight =  get("photo"+currentLightBoxImage).naturalHeight;
	}
	get("overlayDiv").style.backgroundColor = '#999999';
	get("overlayDiv").style.width = imageWidth+'px';
	get("overlayDiv").style.height = (imageHeight+20)+'px';
	get("overlayDiv").style.left = ((winW/2)-(imageWidth/2)-15-10)+'px';
	//get("overlayDiv").style.top = (scrollHeight+(winH/2)-(imageHeight/2)-15)+'px';
	get("overlayDiv").style.top = '30px';
	get("propImageNr").style.left = ((imageWidth/2)-50)+"px";
}
function lightBoxNext()
{
	//scrollHeight = (document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);
	currentLightBoxImage++;
	if(currentLightBoxImage>nrOfLightBoxImages){
		currentLightBoxImage = 1;
	} 
	get("propImageNr").innerHTML = 'image '+currentLightBoxImage+' of '+nrOfLightBoxImages;
	imageSRC = get("photo"+currentLightBoxImage).src;
	get("largeImage").src = imageSRC;
	if(typeof get("photo"+currentLightBoxImage).naturalWidth == "undefined"){
		imageWidth =  get("largeImage").offsetWidth;
		imageHeight =  get("largeImage").offsetHeight;
	} else {
		imageWidth =  get("photo"+currentLightBoxImage).naturalWidth;
		imageHeight =  get("photo"+currentLightBoxImage).naturalHeight;
	}
	get("overlayDiv").style.backgroundColor = '#999999';
	get("overlayDiv").style.width = imageWidth+'px';
	get("overlayDiv").style.height = (imageHeight+20)+'px';
	get("overlayDiv").style.left = ((winW/2)-(imageWidth/2)-15-10)+'px';
	//get("overlayDiv").style.top = (scrollHeight+(winH/2)-(imageHeight/2)-15)+'px';
	get("overlayDiv").style.top = '30px';
	get("propImageNr").style.left = ((imageWidth/2)-50)+"px";
}
function lightBoxPrev()
{
	//scrollHeight = (document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);
	currentLightBoxImage--;
	if(currentLightBoxImage==0){
		currentLightBoxImage = nrOfLightBoxImages;
	}
	get("propImageNr").innerHTML = 'image '+currentLightBoxImage+' of '+nrOfLightBoxImages;
	imageSRC = get("photo"+currentLightBoxImage).src;
	get("largeImage").src = imageSRC;
	if(typeof get("photo"+currentLightBoxImage).naturalWidth == "undefined"){
		imageWidth =  get("largeImage").offsetWidth;
		imageHeight =  get("largeImage").offsetHeight;
	} else {
		imageWidth =  get("photo"+currentLightBoxImage).naturalWidth;
		imageHeight =  get("photo"+currentLightBoxImage).naturalHeight;
	}
	get("overlayDiv").style.backgroundColor = '#999999';
	get("overlayDiv").style.width = imageWidth+'px';
	get("overlayDiv").style.height = (imageHeight+20)+'px';
	get("overlayDiv").style.left = ((winW/2)-(imageWidth/2)-15-10)+'px';
	//get("overlayDiv").style.top = (scrollHeight+(winH/2)-(imageHeight/2)-15)+'px';
	get("overlayDiv").style.top = '30px';
	get("propImageNr").style.left = ((imageWidth/2)-50)+"px";
}

function closeOverlay()
{
	get("overlayDiv").style.display = 'none';	
}





// Validatie
function validateWebTextElement(theFormElement) 
{
	theFormElement.className = theFormElement.className.replace('_error','') 
	if(theFormElement.value.length==0){
		theFormElement.className+='_error';
		validForm=false;
	} 
}

function validateWebEmailElement(theFormElement)
{
	theFormElement.className = theFormElement.className.replace('_error','');
	if (theFormElement.value.length >0) {
		i=theFormElement.value.indexOf("@")
		j=theFormElement.value.indexOf(".",i)
		k=theFormElement.value.indexOf(",")
		kk=theFormElement.value.indexOf(" ")
		jj=theFormElement.value.lastIndexOf(".")+1
		len=theFormElement.value.length
			
		if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3)){
		} else {
			theFormElement.className+='_error';
			validForm = false;
		}
	 } else {
		theFormElement.className+='_error';
		validForm = false;
	}
}





