var paused,counter;
paused = true;
counter = 2;

function toggleView(elementId){
	var element = document.getElementById(elementId);
	
	if (element.style.display == "")
		element.style.display = 'none';
	else
		element.style.display = '';
}


function Center() {
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		 // window.alert( 'Width = ' + myWidth );
		  //window.alert( 'Height = ' + myHeight );
	  
		  document.getElementById('sweetform').style.top = (myHeight/2)-(420/2)+ "px";
//	  	document.getElementById('clock').style.top = 1;
		document.getElementById('sweetform').style.left = (myWidth/2)-(420/2)+ "px";

//		document.getElementById('imgAnimateLDiv').style.top = 0;
//		document.getElementById('imgAnimateLDiv').style.left = (myWidth/2)-(425);

		slideShow("div2");
	  }
function slidepause(strpa, divstr){
		if (!strpa){
			setTimeout("rsetcounter()",10000);
		}
		else{
			paused=strpa;
		}
}

function rsetcounter(){
	pause = false;
	counter++;
	if (counter==2) {
		slideShow('div2')
	}
	else if (counter==3) {
		slideShow('div3');
	}
	else if (counter==1) {
		slideShow('div1');
	}	
}
function slideShow(idstr){
	//Element.hide('img1');

		//alert ("playing");
		document.getElementById('div1').style.display =  "none";
		document.getElementById('div2').style.display = "none";
		document.getElementById('div3').style.display = "none";
		new Effect.Appear(idstr);
	
		if (idstr=='div3'){
			counter=2;	
		}
		else
			counter++; 
		if (counter==2) {
			setTimeout("slideShow('div2')",10000);
		}
		else if (counter==3) {
			setTimeout("slideShow('div3')",10000);
		}
		else if (counter==1) {
			setTimeout("slideShow('div1')",10000);
		}

}

function SlideAnimate() {
new Effect.Fade('div1');

/*var date = new Date();
var curDate = null;

do { curDate = new Date(); } 
while(curDate-date < 8800);
*/

setTimeout("SlideAnimate2()",1800);
}
function SlideAnimate2() {
	new Effect.Appear('div2');
	 setTimeout("startoverFade()",4800);
}

function startoverFade() {
	new Effect.Fade('div2');
	counter=0;
	setTimeout("slideShow('div1')",1800);
}

