//change the opacity for different browsers
var whichpic = 1;

function changeOpac(opacity, id) {
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 101);
	object.MozOpacity = (opacity / 101);
	object.KhtmlOpacity = (opacity / 101);
	object.filter = "alpha(opacity=" + opacity + ")";
}

function blendimage(imageid1, imageid2, imagefile, millisec) {
	if (whichpic == 1) {
		whichpic = 2;
		var fadeoutpic = imageid1;
		var fadeinpic = imageid2;
	} else {
		whichpic = 1;
		var fadeoutpic = imageid2;
		var fadeinpic = imageid1;
	}
	
	var speed = Math.round(millisec / 100);
	var timer = 0;
	
	document.getElementById(fadeoutpic).style.zIndex = "100";
	document.getElementById(fadeinpic).style.zIndex = "1000";
	
	//make new image
	document.getElementById(fadeinpic).src = imagefile;

	//fade out image
	for(i = 100; i > 1; i--) {
		setTimeout("changeOpac(" + i + ",'" + fadeoutpic + "')",(timer * speed));
		timer++;
	}

	//fade in image
	for(i = 0; i < 100; i++) {
		setTimeout("changeOpac(" + i + ",'" + fadeinpic + "')",(timer * speed));
		timer++;
	}
}

function firstfadein(imageid, millisec) {
	var speed = Math.round(millisec / 100);
	var timer = 0;
	for(i = 0; i < 100; i++) {
		setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
		timer++;
	}
}

function uponload(){
	setthumb('thumb33link');
	firstfadein('blendimage1',500);
}
