// JavaScript TIMER
var secs
var timerID = null
var timerRunning = false
var delay = 3000
var cont = 0

function InitializeTimer(tempo) {
	// configura o tempo do timer
	secs = tempo
	StopTheClock()
	StartTheTimer()
}

function StopTheClock() {
	if(timerRunning)
			clearTimeout(timerID)

	timerRunning = false
}

function StartTheTimer() {
	if (secs==0) {
		StopTheClock()
		// AÇÃO A SER EXECUTADA APÓS A ESPERA 
		//alert("Ok.")
		fecharPublicidade('pubfloater');
		//fecharPublicidade2('pubfloater2');

	}
	else
	{
		//self.status = secs
		cont = cont + 1
		//secs = secs - 1
		timerRunning = true
		timerID = self.setTimeout("StartTheTimer()", delay)
		
		if (cont==secs){ 
		fecharPublicidade('pubfloater');}
				
	}

}
