
$(document).ready(function() {
	$("div#Opcionais span").find("div").animate({ opacity: 0.0}, 10);
	$("div#Opcionais span").mouseover(function() {
		$(this).find("div").animate({ opacity: 1.0}, 100);
	});
	$("div#Opcionais span").mouseout(function() {
		$(this).find("div").animate({ opacity: 0.0}, 100);
	});
});

function DataHora(){
	var now = new Date();
	var hours = now.getHours();
	if(hours < 10){
		hours2 = "0"+hours;
	}else{
		hours2 = hours;
	}
	var minutes = now.getMinutes();
	if(minutes < 10){
		minutes2 = "0"+minutes;
	}else{
		minutes2 = minutes;
	}
	
	mydate = new Date();
	myday = mydate.getDay();
	mymonth = mydate.getMonth();
	myweekday = mydate.getDate();
	//weekday= myweekday;
	myyear= mydate.getFullYear();
	//year = myyear;
	
	if(myday == 0){
		day = "Domingo";
	}else if(myday == 1){
		day = "Segunda";
	}else if(myday == 2){
		day = "Terça";
	}else if(myday == 3){
		day = "Quarta";
	}else if(myday == 4){
		day = "Quinta";
	}else if(myday == 5){
		day = " Sexta";
	}else if(myday == 6){
		day = "Sábado";
	}
	
	if(mymonth == 0){
		month = "Janeiro";
	}else if(mymonth == 1){
		month = "Fevereiro";
	}else if(mymonth == 2){
		month = "Março";
	}else if(mymonth == 3){
		month = "Abril";
	}else if(mymonth == 4){
		month = "Maio";
	}else if(mymonth == 5){
		month = "Junho";
	}else if(mymonth == 6){
		month = "Julho";
	}else if(mymonth == 7){
		month = "Agosto";
	}else if(mymonth == 8){
		month = "Setembro";
	}else if(mymonth == 9){
		month = "Outubro";
	}else if(mymonth == 10){
		month = "Novembro";
	}else if(mymonth == 11){
		month = "Dezembro";
	}
	
	if(hours2 < 12){
		SaudacaoText = "Bom dia";
	}else if((hours2 >= 12) && (hours2 < 18)){
		SaudacaoText = "Boa tarde";
	}else{
		SaudacaoText = "Boa noite";
	}
	
	document.getElementById("Dia").innerHTML = day+", "+myweekday+" de "+month+" de "+myyear;
	document.getElementById("Hora").innerHTML = hours2+"h"+minutes2;
	Cufon.replace("#Hora",{ fontFamily : "Tw Cen MT", hover: true });
	//document.getElementById("Saudacao").innerHTML = SaudacaoText; 
	//setInterval(DataHora, 1000);
	setTimeout(DataHora, 1000);
}
//setInterval(DataHora, 1000);


/* BUSCA TOP */
function InputBuscaTop(inputId){
	if(document.getElementById(inputId).value == "Digite aqui o que você procura."){
		document.getElementById(inputId).value = "";
	}else if(document.getElementById(inputId).value == ""){
		document.getElementById(inputId).value = "Digite aqui o que você procura.";
	}else{
		document.getElementById(inputId).value = document.getElementById(inputId).value;
	}
}
function ValidaFormBuscaTop(){
	Form = document.FormBuscaTop;
	if((Form.buscatop.value == "Digite aqui o que você procura.") || (Form.buscatop.value == "")){
		alert("Digite o que você procura!");
		Form.buscatop.focus();
		return false;
	}
	return true;
}

/* Posta recado Mural */
function OpenFormMural(){
	if(document.getElementById("FormCadastraRecado").style.display == "block"){
		document.getElementById("FormCadastraRecado").style.display = "none";
		document.getElementById("FormCadastraRecado").reset();
	}else{
		document.getElementById("FormCadastraRecado").style.display = "block";
	}
}

/* Mouse Hover HOME */
function HoverHome(NameImage){
	document.getElementById("ContHome").style.backgroundImage = "url("+NameImage+")";
}

// CALÇADISTA
function ChangeSelectfgjhg(Valor, Combo){
	if(Valor == ""){
		document.getElementById("AreaCombosCal").style.backgroundPosition = "0px -"+102*parseInt(Combo-1)+"px";
		for(i=0;i<10;i++){
			if((i+1) > (parseInt(Combo)+1)){
				document.getElementById("Sel"+i).disabled = true;
				document.getElementById("Sel"+i).selectedIndex = 0;
			}
		}
	}else{
		if(Combo == "3"){
			document.FormCombosCalcadista.submit();
		}else{
			Cb = "Sel"+(parseInt(Combo)+1);
			document.getElementById(Cb).disabled = false;
			document.getElementById("AreaCombosCal").style.backgroundPosition = "0px -"+102*parseInt(Combo)+"px";
		}
	}
}

// Galeria de fotos INSTITUCIONAL
function LoadImage(DirTotal, img){
	$("#FM_Gal").load(DirTotal+"/DeleteComment.php?id="+id, function(){
		document.getElementById("Comment_"+id).style.display = "none";
	});
}
