/* image rotation code */
rotateImages=['images/P1.jpg', 'images/P2.jpg', 'images/P3.jpg'];
function showNext(ind){window.status=ind	//	ind is the offset of the next img relative to the current index
	if(!ind)			//	with no ind specified we simply move to the next img
		ind=1;
	var img=document.getElementById('rotateimg');	
	if(typeof img.ind != 'number')
		img.ind=1;
	else{
		img.ind+=ind;
		if(img.ind>=rotateImages.length || img.ind<0)
			img.ind=0;
	}
	img.src=rotateImages[img.ind];
}
var rotateTimer=null;
function rotate(){
	showNext();
	rotateTimer=setTimeout(rotate, 3000); 
}
function resetTimer(){
	if(rotateTimer){
		clearTimeout(rotateTimer); 
		rotateTimer=setTimeout(rotate, 3000); 
	}
}
function togglePause(pause){
	if(rotateTimer || pause){
		clearTimeout(rotateTimer); 
		rotateTimer=null;
	}else
		rotateTimer=setTimeout(rotate, 3000); 
}
/* end of image rotation code */

function hideImg(btn){
	btn.childNodes.item(0).style.visibility='hidden';
}
function showImg(btn){
	btn.childNodes.item(0).style.visibility='visible';
}
