	var img = document.getElementById("imageholder");
	var img2 = document.getElementById("imageholder2");

	var y = 1;
	var i = 1;

	function fade(ImageIn, ImageOut) {
		var fin = new YAHOO.util.Anim(ImageIn); 
		fin.attributes.opacity = { to: 1 }; 
		fin.duration = 0.5; 
		fin.method = YAHOO.util.Easing.easeOut; 

		var fout = new YAHOO.util.Anim(ImageOut); 
		fout.attributes.opacity = { to: 0 }; 
		fout.duration = 0.5; 
		fout.method = YAHOO.util.Easing.easeOut; 
		
		fout.animate();
		fin.animate();
		setTimeout("setimage()",4000);
	}
	
	
	function scale(a_img) {
		// alert(img.width+", "+img.height);

		var imgratio = a_img.width/a_img.height;
		var d = document.getElementById("imagerotatediv");
		var w, h;

		if (imgratio > (parseInt(d.style.width)/parseInt(d.style.height))) {
			w = parseInt(d.style.width);
			h = a_img.height * parseInt(d.style.width)/a_img.width;
		} else {
			w = a_img.width * parseInt(d.style.height)/a_img.height;
			h = parseInt(d.style.height);
		}
		
		a_img.style.width = Math.floor(w)+"px";
		a_img.style.height = Math.floor(h)+"px";
	}

	function setimage () 
	{
		if (i == 1) {
			img.style.width = "";
			img.style.height = "";
			img.src = imagearray[y];
			i=0;
		}else{
			img2.style.width = "";
			img2.style.height = "";
			img2.src = imagearray[y];
			i=1;
		}
		
		y++;
		if (y == imagearray.length ) 
			{
				y=1;
			}
	}	

	addLoadEvent(setimage);
