var killphoto=1
var newphoto=2
var botphoto=3
var totphoto=37
function movenext(){
	blendimage('blenddiv'+killphoto,'blenddiv'+newphoto,'blenddiv'+botphoto,700)
	newphoto=newphoto+1
    killphoto=killphoto+1
    botphoto=botphoto+1
	if (newphoto>totphoto){
		newphoto=1	
	}
    if (killphoto>totphoto){
		killphoto=1	
	}
    if (botphoto>totphoto){
		botphoto=1	
	}
}
		
function startit(){
	startit=setInterval ('movenext()', 6000);
}

//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 blendimage(divkill, divnew, divbot, millisec) {
	var speed = Math.round(millisec / 100);
	var timer = 0;
	
	//set the current image as background
	document.getElementById(divnew).style.display='block'
	document.getElementById(divbot).style.zIndex=19
	document.getElementById(divkill).style.zIndex=20
	document.getElementById(divnew).style.zIndex=21
	
	//make image transparent
	changeOpac(0, divnew);
	
	//make new image

	//fade in image
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac(" + i + ",'" + divnew + "')",(timer * speed));
		timer++;
	}
}

