appendLoader(function () {
	if (document.images){
		nextImg = 1;
		maxImgs = 7;	//change this to the total number of images you wish to rotate
		img = new Array(maxImgs + 1);
		//preloading our images
		for (var i = 1; i <= maxImgs; i++) {
			img[i] = new Image(358, 258);
			img[i].src = 'webpic' + i + '.jpg';
		}
		
		YAHOO.util.Dom.setStyle('rotate2', "opacity", "0");
		YAHOO.util.Dom.setStyle('rotate1', "opacity", "1");
		
		time = setTimeout('next()', 4000);
	}
});

function next(){
	if (document.images){
		curImg = nextImg;
		nextImg++;
		if (nextImg > maxImgs){
			nextImg = 1;
		}
		if (YAHOO.util.Dom.getStyle('rotate2', 'opacity') == 0){
			document.images['rotate2'].setAttribute('src', img[nextImg].src);
			setTimeout('Show.animate()', 6000);
		}else{
			document.images['rotate1'].setAttribute('src', img[nextImg].src);
			setTimeout('Hide.animate()', 6000);
		}
	}
	setTimeout('next()', 10000);
}
