<!--
//MODIFIED FROM http://www.brainerror.net/scripts_js_blendtrans.php

function opacity(id,opacStart,opacEnd,millisec) {
	//speed for each frame
	var speed = Math.round(millisec / 100);
	var timer = 0;

	//determine the direction for the blending, if start and end are the same nothing happens
	if (opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			if (i <= 10) {
				i= 0;
			}
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++) {
			if (i >= 90) {
				i= 100;
			}

			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}

//change the opacity for different browsers
function changeOpac(opacity,id) {
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100);						//SAFARI,FIREFOX,CSS3
	object.MozOpacity = (opacity / 100);					//OLD MOZILLA
	object.KhtmlOpacity = (opacity / 100);					//OLD KONQUEROR AND OLD SAFARI/WEBKIT
	object.filter = "alpha(opacity=" + opacity + ")";		//IE
}

//MY CODE
function hideImage(strarray,imgid,current) {
	opacity(imgid,100,0,750);
	setTimeout("changeImage('"+strarray+"','"+imgid+"',"+current+");",1000);
}

function changeImage(strarray,imgid,current) {
	arrayname = eval(strarray);
	current = (current >= arrayname.length - 1) ? 0 : current + 1;
	document.getElementById(imgid).src = arrayname[current];
	
	setTimeout("showImage('"+strarray+"','"+imgid+"',"+current+");",250);
}

function showImage(strarray,imgid,current) {
	opacity(imgid,0,100,750);
	setTimeout("hideImage('"+strarray+"','"+imgid+"',"+current+");",7500);
}

//-->