function noError(){return true;}
window.onerror = noError;


var page="";
function laadpagina(pagina){
	createXMLHttpRequest();
	xmlHttp.onreadystatechange=handleStateChange;
	page=pagina;
	xmlHttp.open("GET","pages/"+pagina+".php?dummy=" + new Date().getTime(),true);
	xmlHttp.send(null);
}


function handleStateChange(){
	if(xmlHttp.readyState==0){
		document.getElementById('content').innerHTML="<img src='images/ajaxloader.gif'/>";	
	}
	
	if(xmlHttp.readyState==1){
		document.getElementById('content').innerHTML="<img src='images/ajaxloader.gif'/>";	
	}
	
	if(xmlHttp.readyState==2){
		document.getElementById('content').innerHTML="<img src='images/ajaxloader.gif'/>";	
	}
	
	if(xmlHttp.readyState==3){
		document.getElementById('content').innerHTML="<img src='images/ajaxloader.gif'/>";	
	}
	if(xmlHttp.readyState==4){
		if(xmlHttp.status==200){
			document.getElementById('content').innerHTML=xmlHttp.responseText;
			
			if(page=="uitrusting"){
				haal_fotos_op("materiaal",0);	
			}
			
			if(page=="afbraakwerken"){
				haal_fotos_op("afbraakwerken",0);	
			}
			
			if(page=="gevelbekleding"){
				haal_fotos_op("gevelbekleding",0);	
			}
			
			if(page=="isolatie"){
				haal_fotos_op("isolatie",0);	
			}
			
			if(page=="platform"){
				haal_fotos_op("platform",0);	
			}
			
			if(page=="renovatie"){
				haal_fotos_op("renovatie",0);	
			}
			
			if(page=="klussen"){
				haal_fotos_op("klussen",0);	
			}
			
			if(page=="dakopbouw"){
				haal_alle_fotos_op("dakopbouw");	
			}
		}
	}
}

