// JavaScript Document

		window.addEventListener?window.addEventListener("load",img_init,false):window.attachEvent("onload",img_init);

		var d=document, imgs1 = new Array(),imgs2 = new Array(),imgs3 = new Array(), zInterval = null, current=0, pause=false;
		var counterValue = 0;
		var bahTwo = true;
		var checkForFunction = true;
		
		function img_init() {			
			if(!d.getElementById || !d.createElement)return;			
			
			imgs1 = d.getElementById("image1").getElementsByTagName("img");
			imgs2 = d.getElementById("image2").getElementsByTagName("img");
			imgs3 = d.getElementById("image3").getElementsByTagName("img");
			for(i=1;i<imgs1.length;i++){
				imgs1[i].xOpacity = 0;}
			for(j=1;j<imgs2.length;j++){
				imgs2[j].xOpacity = 0;}
			for(k=1;k<imgs3.length;k++){
				imgs3[k].xOpacity = 0;}
			imgs1[0].xOpacity = .99;
			imgs2[0].xOpacity = .99;
			imgs3[0].xOpacity = .99;

			setTimeout(xfade,4000);
			previousImage = current;
			
			if(checkForFunction == true) {
				checkForFunction = false;
			}			
		}
	
		function xfade() {
			cOpacity = imgs1[current].xOpacity;
			nIndex = imgs1[current+1]?current+1:0;
			nOpacity = imgs1[nIndex].xOpacity;
			
			cOpacity-=.05; 
			nOpacity+=.05;
			
			imgs1[nIndex].style.display = "inline";
			imgs1[current].xOpacity = cOpacity;
			imgs1[nIndex].xOpacity = nOpacity;
			imgs2[nIndex].style.display = "inline";
			imgs2[current].xOpacity = cOpacity;
			imgs2[nIndex].xOpacity = nOpacity;
			imgs3[nIndex].style.display = "inline";
			imgs3[current].xOpacity = cOpacity;
			imgs3[nIndex].xOpacity = nOpacity;
			
			setOpacity(imgs1[current]); 
			setOpacity(imgs1[nIndex]);
			setOpacity(imgs2[current]); 
			setOpacity(imgs2[nIndex]);
			setOpacity(imgs3[current]); 
			setOpacity(imgs3[nIndex]);
					
			if(cOpacity<=0) {
				
				imgs1[current].style.display = "none";
				imgs2[current].style.display = "none";
				imgs2[current].style.display = "none";
				current = nIndex;
				imgs1[previousImage].style.top = "0px";
				imgs1[previousImage].style.left = "0px";	
				imgs2[previousImage].style.top = "0px";
				imgs2[previousImage].style.left = "0px";
				imgs3[previousImage].style.top = "0px";
				imgs3[previousImage].style.left = "0px";			
				
				setTimeout(xfade,4000);
				previousImage = current;
				bahTwo = true;
				
			} else {
				setTimeout(xfade,50);
			}
			
			function setOpacity(obj) {
				if(obj.xOpacity>.99) {
					obj.xOpacity = .99;
					obj.style.filter = "alpha(opacity=100)";
					return;
				}
				else {
					obj.style.filter = "alpha(opacity=" + (obj.xOpacity*100) + ")";
				}
				obj.style.opacity = obj.xOpacity;
				obj.style.MozOpacity = obj.xOpacity;
			}
			
		}

