function startPics(aPicArray) {
	currentOpacity[0]=100;
	for(i=1;i<aContentArray.length;i++) {
		currentOpacity[i]=0;
	}
	mHTML="";
	for(i=0;i<aContentArray.length;i++) {
		mHTML += "<div id=\"photo" + i + "\" name=\"photo" + i + "\" class=\"mPhoto\" " + (i>0 ? "style=\"display:none;\"" : "") + ">" + aContentArray[i] +"</div>";
	//alert(mHTML);
	}
	document.getElementById("mContainer").innerHTML = mHTML + '<div id="mEmpty"><img src="img/spacer.gif" width="170" height="100"></div>';

	//alert(mHTML);
	if(document.all) {
		document.getElementById("photo" + currentPhoto).style.filter="alpha(opacity=100)";
		document.getElementById("photo" + currentPhoto).style.zIndex = 100;
	} else {
		document.getElementById("photo" + currentPhoto).style.MozOpacity = 1;
		document.getElementById("photo" + currentPhoto).style.zIndex = 100;
	}
	if(aContentArray.length > 1) {
		mInterval = setTimeout('setInterval("crossFade()",nFadeInterval)',2000);
	}
}

function crossFade() {
	if(pause)return;
	currentOpacity[currentPhoto] -= nFadeStep;
	currentOpacity[secondPhoto] += nFadeStep;
	if(document.all) {
		document.getElementById("photo" + currentPhoto).style.filter = "alpha(opacity=" + currentOpacity[currentPhoto] + ")";
		document.getElementById("photo" + secondPhoto).style.filter = "alpha(opacity=" + currentOpacity[secondPhoto] + ")";
	} else {
		document.getElementById("photo" + currentPhoto).style.MozOpacity = currentOpacity[currentPhoto]/100;
		document.getElementById("photo" + secondPhoto).style.MozOpacity =currentOpacity[secondPhoto]/100;
	}
	document.getElementById("photo" + currentPhoto).style.zIndex = 1;
	document.getElementById("photo" + secondPhoto).style.zIndex = 100;
	
	if(currentOpacity[secondPhoto]>=1) {
		document.getElementById("photo" + secondPhoto).style.display = 'block';
	}
	
	if(currentOpacity[secondPhoto]/100>=1) {
		document.getElementById("photo" + currentPhoto).style.display = 'none';
		document.getElementById("mEmpty").style.display = 'none';
		document.getElementById("photo" + secondPhoto).style.display = 'block';
		currentPhoto = secondPhoto;
		secondPhoto++;
		if(secondPhoto == aContentArray.length) {
			secondPhoto=0;
		}
		pause = true;

		if(document.all) {
			document.getElementById("photo" + currentPhoto).style.filter = "alpha(opacity=100)";
			document.getElementById("photo" + secondPhoto).style.filter = "alpha(opacity=0)";
		} else {
			document.getElementById("photo" + currentPhoto).style.MozOpacity = 1;
			document.getElementById("photo" + secondPhoto).style.MozOpacity = 0;
		}
		document.getElementById("photo" + currentPhoto).style.zIndex = 100;
		document.getElementById("photo" + secondPhoto).style.zIndex = 1;

		//alert(document.getElementById("photo" + currentPhoto).style.filter)
		xInterval = setTimeout("pause=false",2000);
	}
}
