// JavaScript Document
function Abrir(URL) {

  var width = 600;
  var height = 300;

  var left = 99;
  var top = 99;

  window.open(URL,'a', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=yes, toolbar=yes, location=yes, directories=no, menubar=yes, resizable=yes, fullscreen=no');

}
	
function OverMenu(qObject)
{
	qObject.style.backgroundColor='#efefef';
	qObject.style.cursor = 'hand';
}

function OutMenu(qObject)
{
	qObject.style.backgroundColor='#ffffff';
	qObject.style.cursor = '';
}

///////////////////////////////////////////////////////////////////////////////////
// VALIDA CAMPOS FORMULARIO SEJA UM VOLUNTARIO //

function ValidaSemPreenchimento(form){
	for (i=0;i<form.length;i++){
		if (form[i].value == ""){
			var nome = form[i].name
			alert("O campo " + nome + " é obrigatório.")
			form[i].focus();
			return false
		}
	}
	return true
}
///////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////
//POP-UP GALERIA
function AbrirJanela(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
  }

/////////////////////////////////////////////////////////////////////////////////


function getTime() {

now = new Date();

y2k = new Date("jun 17 2007 08:30:00");

Limite = new Date("jun 01 2007 08:30:00");

days = (y2k - now) / 1000 / 60 / 60 / 24;

daysRound = Math.floor(days);

hours = (y2k - now) / 1000 / 60 / 60 - (24 * daysRound);

hoursRound = Math.floor(hours);

minutes = (y2k - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);

minutesRound = Math.floor(minutes);

seconds = (y2k - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);

secondsRound = Math.round(seconds);

sec = (secondsRound == 1) ? " segundo" : " segundos";

min = (minutesRound == 1) ? " minuto" : " minutos, ";

hr = (hoursRound == 1) ? " hora" : " horas, ";

dy = (daysRound == 1)  ? " dia" : " dias, "

document.timeForm.input1.value = daysRound  + dy + hoursRound + hr + minutesRound + min + secondsRound + sec + " ";



Semanas = daysRound / 7;

Sem = (Semanas == 1) ? " Semana" : " Semanas";

SemFiltrada = parseInt(Semanas);

document.timeForm.input2.value =  SemFiltrada + Sem + " ";

newtime = window.setTimeout("getTime();", 1000);







if(now > Limite){

	document.timeForm.MUDAAKI.style.backgroundColor='#E01B22';

	document.timeForm.txtSemanas.style.backgroundColor='#E01B22';

}else{

	document.timeForm.MUDAAKI.style.backgroundColor='#FFFFFF';

	document.timeForm.txtSemanas.style.backgroundColor='#FFFFFF';

}


}