hoje = new Date()
dia = hoje.getDate()
dias = hoje.getDay()
mes = hoje.getMonth()
ano = hoje.getYear()

if (dia < 10)
	dia = "0" + dia

if (ano < 2000)
	ano = "2011"

function CriaArray (n) {
	this.length = n }

	NomeDia = new CriaArray(7)

	NomeDia[0] = "Domingo"
	NomeDia[1] = "Segunda-feira"
	NomeDia[2] = "Terça-feira"
	NomeDia[3] = "Quarta-feira"
	NomeDia[4] = "Quinta-feira"
	NomeDia[5] = "Sexta-feira"
	NomeDia[6] = "Sábado"

	NomeMes = new CriaArray(12)

	NomeMes[0] = "Janeiro"
	NomeMes[1] = "Fevereiro"
	NomeMes[2] = "Março"
	NomeMes[3] = "Abril"
	NomeMes[4] = "Maio"
	NomeMes[5] = "Junho"
	NomeMes[6] = "Julho"
	NomeMes[7] = "Agosto"
	NomeMes[8] = "Setembro"
	NomeMes[9] = "Outubro"
	NomeMes[10] = "Novembro"
	NomeMes[11] = "Dezembro"

function WriteDate() { document.write (NomeDia[dias] + ", " + dia + " de " + NomeMes[mes] + " de " + ano); }

function MoveRelogio(){
	
	Cronometro();
	
	setTimeout("MoveRelogio()",1000)

}

contador = 0;
parado = false;

function Cronometro() {

	if (parado == false) {

		contador++;

		if (contador == 3) { MostrarDestaque('2'); }
			
		if (contador == 6) { MostrarDestaque('3'); }
			
		if (contador == 9) { MostrarDestaque('4'); }
			
		if (contador == 12) { MostrarDestaque('1'); }
			
		if (contador > 12) { contador = 0; }
	
	}
}

function MostrarDestaque(n,v) {
	if(v == 5){ parado = true;}
	document.getElementById("noticia1").style.background="url(images/fundo_noticia1.png)";
	document.getElementById("noticia2").style.background="url(images/fundo_noticia1.png)";
	document.getElementById("noticia3").style.background="url(images/fundo_noticia1.png)";
	document.getElementById("noticia4").style.background="url(images/fundo_noticia1.png)";

	document.getElementById("destaque1").style.display = "none";
	document.getElementById("destaque2").style.display = "none";
	document.getElementById("destaque3").style.display = "none";
	document.getElementById("destaque4").style.display = "none";

	document.getElementById("noticia"+n).style.background="url(images/fundo_noticia2.png)";
	document.getElementById("destaque"+n).style.display = "inline";

	contador = (n-1) * 3;
	

}
function Mover(j) {
	if(j == 1){ parado = false;}

}

function Parar(t) {
	if(t == 1){ parado = true;}

}
