//DATA ATUAL ------------------------
	hoje = new Date();
	dia = hoje.getDate();
	dias = hoje.getDay();
	mes = hoje.getMonth();
	ano = hoje.getFullYear();
	if (dia < 10) {
		dia = "0" + dia;
	}
	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&ccedil;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 (dia + " de " + NomeMes[mes] + " de " + ano);
}
//VALIDAR NEWSLETTER ----------------
function checkMail(mail){
    var er = new RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/);
    if(typeof(mail) == "string"){
        if(er.test(mail)){ return true; }
    }else if(typeof(mail) == "object"){
        if(er.test(mail.value)){ 
                    return true; 
                }
    }else{
        return false;
        }
}
function vfNews()
{
  var obj = document.getElementById('email');
  var txt = obj.value;
  if ((txt.length != 0) && ((txt.indexOf("@") < 1) || (txt.indexOf('.') < 7)))
  {
    alert('Email incorreto');
	return false
  } else {
	  return true;
  }
}
function vfNews2(){
	var email = document.getElementById('email');
	if ($('#email').val() == "Seu email" || $('#email').val() == "" || $('#email').val() == null) {
		window.alert("Digite seu email");
		email.focus();
		return false
	}
	return true;
}
function evento(eve) {
	if(eve){
		if ($('#email').val() == "Seu email"){
			$('#email').val("");
		}
	} else {
		if ($('#email').val() == "" || $('#email').val() == null ){
			$('#email').val("Seu email");
		}
	}
}
//-----------------------------------
//MENU GERAL ------------------------
var obj = null;
function checkHover() {
	if (obj) {
		obj.find('ul').hide('fast');
	} //if
} //checkHover
$(document).ready(function() {
	$('#menuGeral > li').hover(function() {
		if (obj) {
			obj.find('ul').hide('fast');
			obj = null;
		} //if
		$(this).find('ul').show('fast');
	}, function() {
		obj = $(this);
		setTimeout("checkHover()",400);
	});
});
// POPUP     -------------------------

function opw(url,nome,w,h) {
	window.open(url,nome,'width='+w+',height='+h+',toolbar=0,resizable=0');
	return false;
}

//------------------------------------
function foto(path,s,n) {
	
	var size,num;
	var pasta = path;
	
	if (s!=null) {
		size = s;
	} else {
		size = "ns";
	}
	if (n!=null) {
		num = n;
	} else {
		num = "ns";
	}
	
	$.ajax({
		 type: "POST",
		 url: "http://www.fcrs.edu.br/lib/api.albumImage.php",
		 data: "path="+pasta+"&size="+size+"&ti="+num,
		 success: function(msg){
			 $('#afoto').html(msg);
			 $('a.lightbox').lightbox();
			 //document.write(msg);
			 //mkp = msg
			 //window.alert(mkp);
			 //document.write(mkp);
			 //document.write("lalala");
		 }
	});
}
function fotoExp(expan) {
	var boxh = $('#boxIGH').css('height')
	if (expan) {
		$("#boxIGC").animate({ height: boxh }, 700 );
	} else {
		$("#boxIGC").animate({ height: "100px" }, 700 );
	}
}

// Hotlink --------------------------
function hotlink2 () {
	var title = document.title;
	var url = document.location;	
	$.ajax({
		 type: "POST",
		 url: "http://www.fcrs.edu.br/lib/api.hotlinks.php",
		 data: "act=send&title="+title+"&url="+url,
		 success: function(msg){
			 return null;
		 }
	});	
}






