var oudeHoogte=document.body.clientHeight
var oudeBreedte=document.body.clientWidth
//========================
function makePageAgain(aanroeper){
	if(aanroeper==1){if((oudeHoogte!=document.body.clientHeight)||(oudeBreedte!=document.body.clientWidth))makePage()}
	else if(aanroeper==2){if((oudeHoogte!=document.body.clientHeight)||(oudeBreedte!=document.body.clientWidth))makePage2()}
	else{if((oudeHoogte!=document.body.clientHeight)||(oudeBreedte!=document.body.clientWidth))makePage3()}
}//funct
//========================
function makePage(){
	var resolutie = 25
	var breed = Math.ceil(document.body.clientWidth/resolutie)+1
	var hoog = Math.ceil(document.body.clientHeight/resolutie)+1
	var	string = '<html><head><script language="JavaScript" src="script.js"></script></head>'
	string += '<body leftmargin="0" topmargin="0" onResize="makePageAgain(1);" scroll=no>'
	string +='<table height="100%" width="100%" cellpadding="0" cellspacing="0" '
	string +='onClick="next(1);" style="cursor: hand;">'
	for(var iHoog = 1; iHoog <= hoog; iHoog++){//for1
		string +='<tr>'  
		for(var iBreed = 1; iBreed <= breed; iBreed++){//for2
			string +='<td " height="' + resolutie + '" width="' + resolutie 
			string +='" onMouseOver="over(this)"></td>'
		}//for2
		string +='</tr>'
	}//for1
	string +='</table></body></html>'
	document.write(string)
	document.close()
}//funct
//==========================
function over(cel){
	var kleur = Math.floor(Math.random()*255)+1
	var kleurString = '#ff'+kleur+kleur/2
	cel.bgColor= kleurString
}//funct
//==========================
function makePage2(){
	var resolutie = 10
	var colomBreedte = 15
	var breed = Math.ceil(document.body.clientWidth/resolutie)+1
	var hoog = Math.ceil(document.body.clientHeight/resolutie)+1
	var	string = '<html><head><script language="JavaScript" src="script.js"></script></head>'
	string +='<body leftmargin="0" topmargin="0" onResize="makePageAgain(2);" onLoad="setColor();"'
	string +='scroll=no><center><table height="100%" width="'+ (resolutie*colomBreedte)
	string +='" cellpadding="0" cellspacing="0" '
	string +='onClick="next(2);" style="cursor: hand;">'
	for(var iHoog = 1; iHoog <= hoog; iHoog++){//for1
		string +='<tr>'  
		for(var iBreed = 1; iBreed <= colomBreedte; iBreed++){//for2
			string +='<td " height="' + resolutie + '" width="' + resolutie 
			string +='" onMouseOver="over2(this)"></td>'
		}//for2
		string +='</tr>'
	}//for1
	string +='</center></table></body></html>'
	document.write(string)
	document.close()
}
//==========================
function over2(cel){
		cel.bgColor= document.body.bgColor
}//funct
//==========================
function makePage3(){
	var breed = Math.ceil(document.body.clientWidth)+1
	var celHoog = 2
	var hoog = Math.ceil(document.body.clientHeight/celHoog)+1
	var	string = '<html><head><script language="JavaScript" src="script.js"></script></head>'
	string +='<body leftmargin="0" topmargin="0" onResize="makePageAgain(3);" onLoad="setColor();"'
	string +='scroll=no><center><table height="100%" width="100%" cellpadding="0" cellspacing="0" '
	string +='onClick="next(3);" style="cursor: hand;">'
	for(var iHoog = 1; iHoog <= hoog; iHoog++){//for1
		string +='<tr><td " height="' + celHoog + '" width="' + breed 
		string +='" onMouseOver="over3(this)"></td></tr>'
	}//for1
	string +='</center></table></body></html>'
	document.write(string)
	document.close()	
}//funct
//==========================
function over3(cel){
		if(cel.bgColor!='#ffffff')cel.bgColor='#ffffff'
		else over(cel)
}//funct
//==========================
function setColor(){
	for(var i=0; i<document.all.length; i++){
		var kleur = Math.floor(Math.random()*255)+1
		var kleurString ='#ff'+kleur+kleur/2
		document.all[i].bgColor= kleurString
	}//for
}
//==========================
function next(step){
	if(step==1)document.location.replace("index2.html")
	else if(step==2)document.location.replace("index3.html")
	else document.location.replace("../ride/index.html")
}
