/*
	JavaScript para o Site da Impera
	Desenvolvido por: Impera Developement Team
	Data: 25/07/2007	
*/

//	Função para abrir e fechar a descrição das clientes no porfólio
function abreDescricaoPortifoloClintes(elementoClicado)
{
	var clienteClicado = elementoClicado.getAttribute("name");
	var divRelacionado = "div" + clienteClicado;
	var objetoDivRelacionado = document.getElementsByName(divRelacionado);
	
	if (objetoDivRelacionado[0].style.display == "none")
	{
		objetoDivRelacionado[0].style.display = "table";
	}
	else
	{
		objetoDivRelacionado[0].style.display = "none";
	}
}


//	Funções para timer do Flash de Iniício
var secs
var timerID = null
var timerRunning = false
var delay = 1000

function InitializeTimer()
{
    // Set the length of the timer, in seconds
    secs = 10
    StopTheClock()
    StartTheTimer()
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer()
{
    if (secs==0)
    {
        StopTheClock()
        // Here's where you put something useful that's
        // supposed to happen after the allotted time.
        // For example, you could display a message:
        window.location("http://google.com");
		alert("You have just wasted 10 seconds of your life.")
    }
    else
    {
        self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}
