var s;

function CarregarPagina(pagina, div, site, aux, AuxUrl){
	
	var pg = ""
	
	if(site==6){
		window.open("http://www.promofair.com.br/educar/educar2006/ed2006-educador-programa-dia03maio.htm",'teste','width=780,height=530,scrollbars=no')
	}
	else{
		if(document.all)
		{
			pg = 'funcs/pagina.asp?div='+ div +'&IdSite='+ site +'&aux='+ aux +'&pagina='+ escape(pagina) +"&AuxUrl="+ escape(AuxUrl)
		}
		else
		{
			//pg = caminho + 'funcs/pagina.asp?div='+ div +'&IdSite='+ site +'&aux='+ aux +'&pagina='+ escape(pagina) +"&AuxUrl="+ escape(AuxUrl)
			
			caminho = window.location;
			
			if(site==1)
				caminho = "http://www.coc.com.br/"
			if(site==2)
				caminho = "http://www.faculdadescoc.com.br/"
			if(site==9)
				caminho = "http://www.coc.com.br/"
			if(site==10)
			{
				var str = new String(caminho);
				if(str.indexOf("faculdadescoc") > 0)
					caminho = "http://www.faculdadescoc.com.br/"
				if(str.indexOf("ceforp") > 0)
					caminho = "http://www.ceforp.com.br/"
				if(str.indexOf("jornal.coc") > 0)
					caminho = "http://www.jornal.coc.com.br/"
				if(str.indexOf("cocsaopaulo") > 0)
					caminho = "http://www.cocsaopaulo.com.br/"										
			}
			if(site==20)
				caminho = "http://www.ceforp.com.br/"
			if(site==24)
				caminho = "http://www.coc.com.br/"				
			if(site==28)
			{
				if(window.location == 'http://www.ceforp.com.br/')
					caminho = window.location;
				else
					caminho = 'http://www.faculdadescoc.com.br/';
			}
			
			if(site==30)
				caminho = "http://www.coc.com.br/"	
			if(site==36)
				caminho = "http://www.coc.com.br/"	
			if(site==37)
				caminho = "http://www.coc.com.br/"
			if(site==38)
				caminho = "http://www.coc.com.br/"
			if(site==39)
				caminho = "http://www.coc.com.br/"
			if(site==42)
				caminho = "http://www.coc.com.br/"

			pg = caminho + 'funcs/pagina.asp?div='+ div +'&IdSite='+ site +'&aux='+ aux +'&pagina='+ escape(pagina) +"&AuxUrl="+ escape(AuxUrl)
		}
		
		window.info.location.href = pg;
		
		//parent.document.getElementById('info').src = pg;
	}
		
}

function CarregarPaginaAbs(pagina, div, site, aux, AuxUrl){

	pg = 'http://www.coc.com.br/funcs/pagina.asp?div='+ div +'&IdSite='+ site +'&aux='+ aux +'&pagina='+ escape(pagina) +"&AuxUrl="+ escape(AuxUrl)
	window.info.location.href = pg;	

}

function AOLTeste(){
	
	var f = document.forms['frmEstudoCom'];
	
	CarregarPagina('AOLEstudoCom.asp?Id_Curso='+f.id_curso.value +'&Id_Disciplina='+ f.id_disciplina.value +'&<%=parametros(2)%>','DivAOL',2)
	
	}


function CarregarPagina2(formulario){
	
	switch (formulario){
		case 1:
			var f = document.forms['Dados1']
			break;
		case 2:
			var f = document.forms['Dados2']
			break;
		case 3:
			var f = document.forms['Dados3']
			break;
		case 4:
			var f = document.forms['Dados4']
			break;
		case 5:
			var f = document.forms['Dados5']
			break;
		case 6:
			var f = document.forms['Dados6']
			break;	
		case 7:
			var f = document.forms['Dados7']
			break;
		case 8:
			var f = document.forms['Dados8']
			break;	
		case 9:
			var f = document.forms['Dados9']
			break;	
		case 10:
			var f = document.forms['Dados10']
			break;
		case 11:
			var f = document.forms['Dados11']
			break;												
	}
		
	f.action = 'http://www.unicoc.com.br/uic/'
	f.target = 'blank_'
	f.submit();	

	}



function redim(iframe)
{
	
	if(navigator.appName=="Microsoft Internet Explorer")
		var altura = parseInt(document.body.scrollHeight);
	else
		var altura = parseInt(document.body.offsetHeight);

	parent.document.getElementById(iframe).style.height = altura + 'px';
			
}

function ancora(obj){

	document.location = "#"+ obj;
	//var x = setInterval('titulo("Sistema COC de Ensino")', 1)
	titulo('Sistema COC de Ensino');
}

function telaCheia(){
	 if (MediaPlayer.playState == 3) // check wmplayer status
	{
		MediaPlayer.fullscreen='true';
	}
}     


function titulo(msg){

	document.title = msg;
	
}

function AbreDivMenu(IDMenu){
	if(document.getElementById('mm'+IDMenu).style.display=='none'){
		document.getElementById('mm'+IDMenu).style.display = 'block';
	}
	else{
		document.getElementById('mm'+IDMenu).style.display = 'block';
		document.getElementById('mm'+IDMenu).style.display = 'none';
	}
}

function ancora2(obj){	
	var f = document.forms['txtForm'];
	f.elements[obj].focus();
}

function ValidaEnqueteJornal(){
	
	var f    = document.forms['EnqueteSite']
	
	//f.target = 'info';
	f.action = '../funcs/enquete.asp'
	f.submit();	

}

function ValidaEnqueteThathi(){
	
	var f    = document.forms['EnqueteSite']
	
	f.target = 'info';
	f.action = 'funcs/enqueteThathi.asp'
	f.submit();	

}

function MostraTelaCheia()
{
	if(navigator.appName=="Microsoft Internet Explorer"){
		document.getElementById('tela').style.display = 'block';
	}											
	else{
		document.getElementById('tela').style.display = 'none';
	}	
}

function FaleConosco(opc, id){
	
	if(opc == 1){
		document.getElementById('escolhaDestino').style.display = 'none';	
		document.getElementById('formulario').style.display     = 'block';
		CarregarPagina('funcs/RetornaDestinatarioFaleConosco.asp?IdContato='+ id,'destino',0)
	}
	if(opc == 2){
		document.getElementById('escolhaDestino').style.display = 'block';	
		document.getElementById('formulario').style.display     = 'none';
		var f = document.forms['FaleConosco']
		f.reset();
	}
	ancora('topo')
}

function FaleConoscoThathi(opc, id){
	
	if(opc == 1){
		document.getElementById('escolhaDestino').style.display = 'none';	
		document.getElementById('formulario').style.display     = 'block';
		CarregarPagina('funcs/RetornaDestinatarioFaleConoscoThathi.asp?IdContato='+ id,'destino',0)
	}
	if(opc == 2){
		document.getElementById('escolhaDestino').style.display = 'block';	
		document.getElementById('formulario').style.display     = 'none';
		var f = document.forms['FaleConosco']
		f.reset();
	}
	ancora('topo')
}

function ValidaBolao(){

	var f = document.forms['form'];

	if(f.codigo.value == ''){
		alert('Preencha seu código!');
		f.codigo.focus();
		return;
	}
	
	if(f.nome.value == '' || f.nome.value.length < 5){
		alert('Preencha corretamente seu nome!');
		f.nome.focus();
		return;
	}	
	
	if (f.email.value == '' || f.email.value.indexOf(".") < 2 || f.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o email!');
		f.email.focus();
		return;
	}
	
	if(f.rg.value == '' || f.rg.value.length < 5){
		alert('Preencha corretamente seu documento de identidade!');
		f.rg.focus();
		return;
	}		
	
	if(f.telefone.value == '' || f.telefone.value.length < 10){
		alert('Preencha corretamente seu telefone!');
		f.telefone.focus();
		return;
	}
	
	if(f.cidade.value == '' || f.cidade.value.length < 3){
		alert('Preencha sua cidade!');
		f.cidade.focus();
		return;
	}
	
	if(f.time1.value == ''){
		alert('Preencha o placar!');
		f.time1.focus();
		return;
	}
	
	if(f.time2.value == ''){
		alert('Preencha o placar!');
		f.time2.focus();
		return;
	}
			
	
	f.target = 'info';
	f.action = 'funcs/BolaoCopa.asp';
	f.submit();

}

function ValidaNews(){

	var f = document.forms['newsletter'];

	if(f.EmailNews.value == ''){
		alert('Preencha o email!');
		f.EmailNews.focus();
		return;
	}
	
	if (f.EmailNews.value == '' || f.EmailNews.value.indexOf(".") < 2 || f.EmailNews.value.indexOf("@") < 2){
		alert('Preencha corretamente o email.');
		f.EmailNews.focus();
		return;
	}	
	
	f.target = 'info';
	f.action = 'funcs/newsletter.asp';
	f.submit();

}

function ValidaNewsThathi(){

	var f = document.forms['newsletter'];

	if(f.EmailNews.value == ''){
		alert('Preencha o email!');
		f.EmailNews.focus();
		return;
	}
	
	if (f.EmailNews.value == '' || f.EmailNews.value.indexOf(".") < 2 || f.EmailNews.value.indexOf("@") < 2){
		alert('Preencha corretamente o email.');
		f.EmailNews.focus();
		return;
	}	
	
	f.target = 'info';
	f.action = 'funcs/newsletterThathi.asp';
	f.submit();

}

function ValidaDebate(){
	
	var f = document.forms['debate'];

	if(f.nome.value == ''){
		alert('Preencha o nome!');
		f.nome.focus();
		return;
	}
	
	if(f.endereco.value == ''){
		alert('Preencha o endereço!');
		f.endereco.focus();
		return;
	}
	
	if(f.cidade.value == ''){
		alert('Preencha a cidade!');
		f.cidade.focus();
		return;
	}
	
	if(f.estado.value == ''){
		alert('Selecione o estado!');
		f.estado.focus();
		return;
	}
	
	if(f.cep.value == ''){
		alert('Preencha o CEP!');
		f.cep.focus();
		return;
	}

	if(f.telefone.value == ''){
		alert('Preencha o telefone!');
		f.telefone.focus();
		return;
	}
	
	if(f.profissao.value == ''){
		alert('Preencha sua profissão!');
		f.profissao.focus();
		return;
	}	
		
	if (f.email.value == '' || f.email.value.indexOf(".") < 2 || f.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o email.');
		f.email.focus();
		return;
	}	
	
	f.target = 'info';
	f.action = 'funcs/InscricaoDebate.asp';
	f.submit();

}

function ValidaMaratona2(){

	var f = document.forms['maratona'];

	if(f.nome.value == ''){
		alert('Preencha o nome!');
		f.nome.focus();
		return;
	}
	
	if(f.endereco.value == ''){
		alert('Preencha o endereço!');
		f.endereco.focus();
		return;
	}
	
	if(f.cidade.value == ''){
		alert('Preencha a cidade!');
		f.cidade.focus();
		return;
	}
	
	if(f.estado.value == ''){
		alert('Selecione o estado!');
		f.estado.focus();
		return;
	}
	
	if(f.instituicao.value == ''){
		alert('Preencha a instituição!');
		f.instituicao.focus();
		return;
	}

	if(f.telefone.value == ''){
		alert('Preencha o telefone!');
		f.telefone.focus();
		return;
	}
		
	if (f.email.value == '' || f.email.value.indexOf(".") < 2 || f.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o email.');
		f.email.focus();
		return;
	}	
	
	f.target = 'info';
	f.action = 'funcs/InscricaoTecnologia.asp';
	f.submit();

}

function ValidaBuscaJornal(){

	var f = document.forms['busca'];

	if(f.busca.value == ''){
		alert('Digite uma palavra!');
		f.busca.focus();
		return;
	}
	
	if(f.busca.value.length < 5){
		alert('Digite uma palavra com no mínimo 5 letras!');
		f.busca.focus();
		return;
	}	

	f.action = '../funcs/buscaNew.asp'
	f.target = 'info';
	f.submit();
	f.busca.value = '';

}

function ValidaBuscaJornalThathi(){

	var f = document.forms['busca'];

	if(f.busca.value == ''){
		alert('Digite uma palavra!');
		f.busca.focus();
		return;
	}

	f.action = '../funcs/buscaThathi.asp'
	f.target = 'info';
	f.submit();
	f.busca.value = '';

}


function ValidaBuscaBook(){

	var f = document.forms['bookPesquisa'];

	if(f.nome_produto.value == ''){
		alert('Digite uma palavra!');
		f.nome_produto.focus();
		return;
	}

	f.action = 'pesquisaBook.asp'
	f.submit();

}

function EnqueteResultado(IdSiteEnquete){
   	var form = document.forms['EnqueteSite']
   	
	form.action='EnqueteResultado.asp?bt=1&IdSiteEnquete='+ IdSiteEnquete;
	form.submit()
}
	
function EnqueteResultadoThathi(IdSite, site){
	CarregarPagina('EnqueteResultadoThathi.asp?bt=1&IdSiteEnquete='+ IdSite +'&IdSite='+ site, 'enqueteThathi', 0)
}


function ValidaContatoFaz(){
	var form = document.forms['Contato']
	
	if (form.nome.value == '')
	{
		alert('Preencha corretamente o campo nome.');
		form.nome.focus();
		return;
	}
	
	if (form.email.value == '' || form.email.value.indexOf(".") < 2 || form.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o campo e-mail.');
		form.email.focus();
		return;
	}

	if (form.msg.value == '')
	{
		alert('Preencha corretamente o campo mensagem.');
		form.msg.focus();
		return;
	}
	
	form.target = 'info';
	form.action = 'funcs/contatoFazendinha.asp';
	form.submit();
}



function ValidaContatoSP(){
	var form = document.forms['formContato']
	
	if (form.nome.value == '')
	{
		alert('Preencha corretamente o campo nome.');
		form.nome.focus();
		return;
	}
	
	if (form.email.value == '' || form.email.value.indexOf(".") < 2 || form.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o campo e-mail.');
		form.email.focus();
		return;
	}

	if (form.assunto.value == '')
	{
		alert('Preencha corretamente o campo assunto.');
		form.assunto.focus();
		return;
	}

	if (form.mensagem.value == '')
	{
		alert('Preencha corretamente o campo mensagem.');
		form.mensagem.focus();
		return;
	}
	
	form.target = 'info';
	form.action = 'funcs/contatoSP.asp';
	form.submit();
}


function ValidaContatoDireito(){
	var form = document.forms['formContatoDir']
	
	if (form.nome.value == '')
	{
		alert('Preencha corretamente o campo nome.');
		form.nome.focus();
		return;
	}
	
	if (form.email.value == '' || form.email.value.indexOf(".") < 2 || form.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o campo e-mail.');
		form.email.focus();
		return;
	}

	if (form.telefone.value == '')
	{
		alert('Preencha corretamente o campo telefone.');
		form.telefone.focus();
		return;
	}

	if (form.assunto.value == '')
	{
		alert('Preencha corretamente o campo assunto.');
		form.assunto.focus();
		return;
	}

	if (form.mensagem.value == '')
	{
		alert('Preencha corretamente o campo mensagem.');
		form.mensagem.focus();
		return;
	}
	
	form.target = 'info';
	form.action = 'funcs/contatoDireito.asp';
	form.submit();
}


function ValidaContatoCOCEscola(){
	var form = document.forms['formCOCEscola']
	
	if (form.nome.value == '')
	{
		alert('Preencha corretamente o campo nome.');
		form.nome.focus();
		return;
	}
	
	if (form.email.value == '' || form.email.value.indexOf(".") < 2 || form.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o campo e-mail.');
		form.email.focus();
		return;
	}

	if (form.telefone.value == '')
	{
		alert('Preencha corretamente o campo telefone.');
		form.telefone.focus();
		return;
	}

	if (form.nomeEscola.value == '')
	{
		alert('Preencha corretamente o campo nome da escola.');
		form.nomeEscola.focus();
		return;
	}

	if (form.endereco.value == '')
	{
		alert('Preencha corretamente o campo endereço.');
		form.endereco.focus();
		return;
	}
	
	if (form.bairro.value == '')
	{
		alert('Preencha corretamente o campo bairro.');
		form.bairro.focus();
		return;
	}	

	if (form.cidade.value == '')
	{
		alert('Preencha corretamente o campo cidade.');
		form.cidade.focus();
		return;
	}	

	if (form.cep.value == '')
	{
		alert('Preencha corretamente o campo cep.');
		form.cep.focus();
		return;
	}	

	if (form.assunto.value == '')
	{
		alert('Preencha corretamente o campo assunto.');
		form.assunto.focus();
		return;
	}

	if (form.mensagem.value == '')
	{
		alert('Preencha corretamente o campo mensagem.');
		form.mensagem.focus();
		return;
	}
	
	form.target = 'info';
	form.action = 'funcs/contatoCOCEscola.asp';
	form.submit();
}


function ValidaContatoEducacao(){
	var form = document.forms['formEducacao']
	
	if (form.nome.value == '')
	{
		alert('Preencha corretamente o campo nome.');
		form.nome.focus();
		return;
	}

	if (form.telefone.value == '')
	{
		alert('Preencha corretamente o campo telefone.');
		form.telefone.focus();
		return;
	}

	if (form.email.value == '' || form.email.value.indexOf(".") < 2 || form.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o campo e-mail.');
		form.email.focus();
		return;
	}
	
	form.target = 'info';
	form.action = 'funcs/contatoEducacao.asp';
	form.submit();
}

// ---------- Barra de Status
//window.defaultStatus="PORTAL | COC";


// ---------- Muda Fundo
function mudaFundo(cor){
	document.body.style.backgroundColor = cor;
}


// ---------- Muda z-index do topo
function trazSubMenu(){
	document.getElementById('divSubMenu').style.zIndex = 5;
}

function voltaSubMenu(){
	document.getElementById('divSubMenu').style.zIndex = -1;
}

// ------------ Conta caracteres
function Conta(formulario){
	var form = document.forms[formulario];
	total = form.mensagem.value.length;
	form.mensagem.focus();
	if(total <= 3000){
		form.total.value = 'Máximo de 3000 caracteres. '+ total +' caracteres já digitados'
	}
	else{
		form.total.value = 'Máximo de 3000 caracteres. 3000 caracteres já digitados'
		form.mensagem.value = form.msg.value.substring(0,3000);
		alert('Excedido o número máximo de caracteres.');
		return;
	}
}

// ---------- Função genérica para abrir div
function AbreDiv(obj){	
	var div;
	div = obj;
	
	if (document.getElementById(div).style.display == "none"){
		document.getElementById(div).style.display = "block";
		}
	else{
		document.getElementById(div).style.display = "none";
    	}		
}

function AbreDivNovoMenu(obj1, obj2, obj3, obj4){	
	var div1, div2, div3, div4;
	div1 = obj1;
	div2 = obj2;
	div3 = obj3;
	div4 = obj4;
	
	if (document.getElementById(div1).style.display == "none"){
		document.getElementById(div1).style.display = "block";
		document.getElementById(div2).style.display = "none";
		document.getElementById(div3).style.display = "none";
		document.getElementById(div4).style.display = "none";
		}
	else{
		document.getElementById(div1).style.display = "none";
    	}		
}

function AbreDivCopa(){		
	if (document.getElementById('copa').style.display == "none"){
		document.getElementById('copa').style.display = "block";
		}
	else{
		document.getElementById('copa').style.display = "none";
    	}
	clearInterval(s)
}


function fechaDiv(){
	s = setInterval("AbreDivCopa()",7000)
}


function AbreDiv2(IDMenu){
	if(document.getElementById('SubMenuTopo_'+IDMenu).style.display=='none'){
		document.getElementById('SubMenuTopo_'+IDMenu).style.display = '';
		document.getElementById('SubMenu_'+IDMenu).style.display = '';
		document.getElementById('SubMenuRodape_'+IDMenu).style.display = '';
	}
	else{
		document.getElementById('SubMenuTopo_'+IDMenu).style.display = 'none';
		document.getElementById('SubMenu_'+IDMenu).style.display = 'none';
		document.getElementById('SubMenuRodape_'+IDMenu).style.display = 'none';
	}
}


function MudaCor(Menu,Cor,Muda){
	if(Muda==1){
		document.getElementById(Menu).style.backgroundColor = '#b6b6b6'
	}
	else{
		document.getElementById(Menu).style.backgroundColor = Cor
	}
}


// ---------- Função genérica para limpar div
function LimpaDiv(obj){	
	var div;
	div = obj;
	document.getElementById(div).innerHTML = ' ';
}

// ---------- Funções Remote
function Mensagem(mode){
		if (!mode)
			document.getElementById('aguarde').style.display = "block";
		else
			document.getElementById('aguarde').style.display = "none";
}

// ---------- Funções genérica para abrir janelas
function AbreJanela(arq,alt,lag,res,barra){
	if(barra=='')
		barra = 0;
	if(navigator.appName=="Microsoft Internet Explorer")
		window.open(arq,'Condi','fullscreen=0,channelmode=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+ barra +',resizable=' + res + ',width=' + lag + ',height=' + alt + ',top=100,left=100');
	else
		window.open(arq,'Condi','location=0,fullscreen=0,menubar=0,toolbar=0,status=0,screenX=100,screenY=100,scrollbars='+ barra +',resizable=1,width=' + lag + ',height=' + alt);
}


function abreFazendinha(){
	window.open('http://www.coc.com.br/fazendinha','fazendinha','width=500, height=500, scrollbars=no');	
}


function abreFotoFazendinha(theURL,winName,features) {
	win = window.open(theURL,winName,features);
	win.focus();
}


function AtualizaCampo(){
	var f = document.forms['faleBook'];
	var area = f.area.value;
		window.location.href = "FaleConosco.asp?area="+area
}

function AtualizaCompra(id){
 	var form = document.forms['form1'];
	var sel = document.getElementById(id).value;
		window.location.href = "compra.asp?codigo_produto="+sel
}


//  ----------  ISSO DAQUI É DO CURRICULO
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' deve conter um endereco de e-mail valido.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' deve conter um valor numérico.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' deve conter um valor numérico entre '+min+' e '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' é necessário.\n'; }
  } if (errors) alert('O(s) seguintes erro(s) foram encontrados:\n'+errors);
  document.MM_returnValue = (errors == '');
  
  	form.action = 'curriculoForm.asp'
	form.target = "info"
	//form.document.location = "#emailEnviado"
	form.submit();
}


function AcresAcademico (iAcad) {
	F = document.fCurriculo;
	for (i=1; i<=iAcad; i++) {
		if (F.elements('Curso' + i).value.length == 0) {
			alert("Por favor, informe o curso de formação acadêmica.");
			F.elements('Curso' + i).focus();
			return;
		}
		if (F.elements('Instituicao' + i).value.length == 0) {
			alert("Por favor, informe a instituição de formação acadêmica.");
			F.elements('Instituicao' + i).focus();
			return;
		}		
		if (F.elements('AnoInicio' + i).value.length == 0) {
			alert("Por favor, informe o ano de início da formação acadêmica.");
			F.elements('AnoInicio' + i).focus();
			return;			
		} else {
			if (!ValidaAno(F.elements('AnoInicio' + i).value)) {
				alert("O ano de início da formação acadêmica não parece ser um ano válido.");
				F.elements('AnoInicio' + i).focus();
				return;						
			}
		}
		if ((F.elements('AnoFinal' + i).value.length > 0) && (!ValidaAno(F.elements('AnoFinal' + i).value))) {
			alert("O ano de término da formação acadêmica não parece ser um ano válido.");
			F.elements('AnoFinal' + i).focus();
			return;						
		}
	}	
	F.Acao.value=1;
	F.submit();
	F.elements('Curso' + iAcad).focus();
}
function AcresExtra (iExtra) {
	F = document.fCurriculo	;
	for (i=1; i<=iExtra; i++) {
		if (F.elements('CursoE' + i).value.length == 0) {
			alert("Por favor, informe o nome do curso extra.");
			F.elements('CursoE' + i).focus();
			return;
		}		
		if (F.elements('InstituicaoE' + i).value.length == 0) {
			alert("Por favor, informe o nome da instituição do curso extra.");
			F.elements('InstituicaoE' + i).focus();
			return;
		}		
		if (F.elements('AnoInicioE' + i).value.length == 0) {
			alert("Por favor, informe o ano de início do curso extra.");
			F.elements('AnoInicioE' + i).focus();
			return;
		}
	}	
	F.Acao.value=2;
	F.submit();
}
function AcresExper (iExper) {
	F = document.fCurriculo	;
	for (i=1; i<=iExper; i++) {
		if (F.elements('EmpresaP' + i).value.length == 0) {
			alert("Por favor, informe o nome da empresa.");
			F.elements('EmpresaP' + i).focus();
			return;
		}		
		if (F.elements('CargoP' + i).value.length == 0) {
			alert("Por favor, informe o nome do cargo exercído.");
			F.elements('CargoP' + i).focus();
			return;
		}
		if (F.elements('AnoInicioP' + i).value.length == 0) {
			alert("Por favor, informe o ano de início da experiência profissional.");
			F.elements('AnoInicioP' + i).focus();
			return;
		} else {
			if (!ValidaAno(F.elements('AnoInicioP' + i).value)) {
				alert("O ano de admissão deve ser um valor numérico válido.");
				F.elements('AnoInicioP' + i).focus();
				return;	
			}
		}
		if ((F.elements('AnoTerminoP' + i).value.length > 0) && (!ValidaAno(F.elements('AnoTerminoP' + i).value))) {
			alert("O ano de demissão deve ser um valor numérico válido.");
			F.elements('AnoTerminoP' + i).focus();
			return;	
		}
	}
	F.Acao.value=3;
	F.submit();
}
function EnviarForm(iCodArea) {
	F = document.fCurriculo	;
	F.Acao.value=4;
	if (F.Nome.value.length==0) {
		alert("Por favor, digite o nome.");
		F.Nome.focus();
		return;
	}
	if (F.Ano.value.length==0) {
		alert("Por favor, digite o ano.");
		F.Ano.focus();
		return;
	} else {
		if (!ValidaAno(F.Ano.value)) {
			alert("O ano de nascimento deve ser um valor numérico válido.");
			F.Ano.focus();
			return;	
		}
	}
	if (F.Nacionalidade.value.length==0) {
		alert("Por favor, digite a nacionalidade.");
		F.Nacionalidade.focus();
		return;
	}
	if (F.Fone.value.length==0) {
		alert("Por favor, digite o telefone.");
		F.Nacionalidade.focus();
		return;
	} else {
		if (isNaN(F.Fone.value)) {
			alert("O telefone deve conter somente números.");
			F.Fone.focus();
			return;
		}
	}
	var bArea = new Boolean(false);
	for (i=1;i<=iCodArea;i++) {
		if (F.elements('c' + i).checked) {
			bArea = true;			
		}
	}
	if (bArea==false) {
		alert("Por favor, marque uma ou mais áreas de interesse.");
		return;
	}
	F.submit();
}
function ValidaAno(iAno){
	if (!isNaN(iAno)) 	{
		if (inRange(iAno, 01, 1900-AnoAtual()+10)) 
			return true;
		if (inRange(iAno, 1901, AnoAtual()+10)) 
			return true;
	} else  {
		return false;
	}
}
function inRange(iNum, iMin, iMax) {
	if (!isNaN(iNum)) {	
		if (iNum>=iMin && iNum <= iMax) 
			return true;
		else
			return false;
	} else 
		return false;
}

function AnoAtual() {
   d = new Date();
   return d.getYear();
}


// --------- Valida Fale Conosco Bookstore
function ValidaFaleBook(){
	
	var f = document.forms['faleBook'];
	
	if(f.nome.value == ''){
		alert('Preencha corretamente o campo nome.');
		f.nome.focus();
		return;
	}
	if (f.email.value == '' || f.email.value.indexOf(".") < 2 || f.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o campo e-mail.');
		f.email.focus();
		return;
	}
	
	f.action = '../funcs/faleBook.asp'
	f.submit();
}


// --------- Valida Email Aluno COC
function ValidaBookAluno(){
	var f = document.forms['emailAluno']
	
	if (f.email.value == '' || f.email.value.indexOf(".") < 2 || f.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o campo E-mail.');
		f.email.focus();
		return;
	}
	
	f.action = '../bookstore/pedidoFinalizadoAluno.asp'
	f.submit();

}


// ---------- Valida Bookstore
function ValidaBook(){
	var f = document.forms['cadastro']
	
	if (f.codValida.value == 4){
		if (f.senha.value == ''){
			alert('Preencha corretamente o campo Senha.');
			f.senha.focus();
		return;
		}
	
		f.action = '../bookstore/alteraSenha.asp?opc=1'
		f.submit();
	}
			
	else{
	
		if (f.nome_cliente.value == '' || f.nome_cliente.value.length < 5){
			alert('Preencha corretamente o campo Nome.');
			f.nome_cliente.focus();
			return;
		}
		if (f.data_nasc.value == '' || f.data_nasc.value.length < 8){
			alert('Preencha corretamente o campo Data de Nascimento.');
			f.data_nasc.focus();
			return;
		}
		if (f.estudante.value == ''){
			alert('Escolha uma opção no campo Estudante.');
			f.estudante.focus();
			return;
		}
		
		if (f.cpf.value == ''){
			alert('Preencha corretamente o campo CPF.');
			f.cpf.focus();
			return;
		}
		else{
			if (!verificarCPF(f.cpf.value)){
				alert("cpf invalido");
				f.cpf.focus();
				return;
			}
		}
		if (f.sexo.value == ''){
			alert('Escolha uma opção no campo Sexo.');
			f.sexo.focus();
			return;
		}
		if (f.logradouro.value == ''){
			alert('Escolha uma opção no campo Logradouro.');
			f.logradouro.focus();
			return;
		}
		if (f.endereco.value == ''){
			alert('Preencha corretamente o campo Endereco.');
			f.endereco.focus();
			return;
		}
		if (f.numero.value == ''){
			alert('Preencha corretamente o campo Número.');
			f.numero.focus();
			return;
		}
		if (f.bairro.value == ''){
			alert('Preencha corretamente o campo Bairro.');
			f.bairro.focus();
			return;
		}
		if (f.cidade.value == ''){
			alert('Preencha corretamente o campo Cidade.');
			f.cidade.focus();
			return;
		}
		if (f.estado.value == ''){
			alert('Escolha uma opção no campo Estado.');
			f.estado.focus();
			return;
		}
		if (f.cep.value == ''){
			alert('Preencha corretamente o campo CEP.');
			f.cep.focus();
			return;
		}
		if (f.email.value == '' || f.email.value.indexOf(".") < 2 || f.email.value.indexOf("@") < 2){
			alert('Preencha corretamente o campo E-mail.');
			f.email.focus();
			return;
		}
		if (f.telefone.value == ''){
			alert('Preencha corretamente o campo Telefone.');
			f.telefone.focus();
			return;
		}
		if (f.ddd.value == ''){
			alert('Preencha corretamente o campo DDD.');
			f.ddd.focus();
			return;
		}
		if (f.noticias.value == ''){
			alert('Preencha corretamente o campo Gostaria de receber notícias.');
			f.noticias.focus();
			return;
		}
		if (f.senha.value == ''){
			alert('Preencha corretamente o campo Senha.');
			f.senha.focus();
			return;
		}
		
		
		if (f.codValida.value == 1){
			f.action = '../funcs/alteraCadastroBook.asp'
			f.submit();
		}
		if (f.codValida.value == 2){
			f.action = '../bookstore/pedidoFinalizado.asp'
			f.submit();
		}
		if (f.codValida.value == 3){
			f.action = '../funcs/cadBook.asp'
			f.submit();
		}
	}
}



 function verificarCPF(c){
	var i; 
	s = c;
	var c = s.substr(0,9); 
	var dv = s.substr(9,2); 
	var d1 = 0; 
	var v = false;
	for (i = 0; i < 9; i++) { 
		d1 += c.charAt(i)*(10-i); 
	} 
	if (d1 == 0){ 
		v = true; 
		return false; 
	} 
	
	d1 = 11 - (d1 % 11); 
	if (d1 > 9) d1 = 0; 
	if (dv.charAt(0) != d1) { 
		v = true;
		return false; 
	} 
	
	d1 *= 2; 
	for (i = 0; i < 9; i++) { 
		d1 += c.charAt(i)*(11-i); 
	} 
	d1 = 11 - (d1 % 11); 
	if (d1 > 9) d1 = 0; 
	if (dv.charAt(1) != d1) { 
		v = true;
		return false; 
	} 
	if (!v) {
		return true
	}
}


// ---------- Valida Fale Diretor

function ValidaDiretor(){
	var form = document.forms['faleDiretor']
	if (form.nome.value == '' || form.nome.value.length < 5){
		alert('Preencha corretamente o campo nome.');
		form.nome.focus();
		return;
	}
	if (form.email.value == '' || form.email.value.indexOf(".") < 2 || form.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o campo e-mail.');
		form.email.focus();
		return;
	}
	if (form.assunto.value == ''){
		alert('Preencha corretamente o campo assunto.');
		form.assunto.focus();
		return;
	}
	 if (form.mensagem.value == ''){
		alert('Preencha corretamente o campo mensagem.');
		form.mensagem.focus();
		return;
	}
	
	form.target = 'info';
	form.action = 'funcs/FaleConoscoThathi.asp';
	form.submit();	
	
}


// ---------- Valida Fale Conosco Thathi COC
function ValidaFaleConoscoThathi(){
	var form = document.forms['FaleConosco']
	
	if (form.nome.value == '' || form.nome.value.length < 5){
		alert('Preencha corretamente o campo nome.');
		form.nome.focus();
		return;
	}
	if (form.email.value == '' || form.email.value.indexOf(".") < 2 || form.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o campo e-mail.');
		form.email.focus();
		return;
	}
	if (form.assunto.value == ''){
		alert('Preencha corretamente o campo assunto.');
		form.assunto.focus();
		return;
	}
	 if (form.mensagem.value == ''){
		alert('Preencha corretamente o campo mensagem.');
		form.mensagem.focus();
		return;
	}
	
	form.target = 'info';
	form.action = 'funcs/FaleConoscoThathi.asp';
	form.submit();
}


// ---------- Valida Fale Presidente
function ValidaPresidente(){
	var form = document.forms['falePresidente']
	if (form.nome.value == '' || form.nome.value.length < 5){
		alert('Preencha corretamente o campo nome.');
		form.nome.focus();
		return;
	}
	if (form.email.value == '' || form.email.value.indexOf(".") < 2 || form.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o campo e-mail.');
		form.email.focus();
		return;
	}
	if (form.assunto.value == ''){
		alert('Preencha corretamente o campo assunto.');
		form.assunto.focus();
		return;
	}
	 if (form.mensagem.value == ''){
		alert('Preencha corretamente o campo mensagem.');
		form.mensagem.focus();
		return;
	}
	
	form.target = 'principal';
	form.action = '../funcs/FaleConosco.asp';
	form.submit();	
	
}

// ---------- Valida Fale Conosco
function ValidaFaleConosco(IdContato){
	var form = document.forms['FaleConosco']
	
	if (form.nome.value == '' || form.nome.value.length < 5){
		alert('Preencha corretamente o campo nome.');
		form.nome.focus();
		return;
	}
	if (form.email.value == '' || form.email.value.indexOf(".") < 2 || form.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o campo e-mail.');
		form.email.focus();
		return;
	}
	if (form.assunto.value == ''){
		alert('Preencha corretamente o campo assunto.');
		form.assunto.focus();
		return;
	}
	 if (form.mensagem.value == ''){
		alert('Preencha corretamente o campo mensagem.');
		form.mensagem.focus();
		return;
	}
	
	form.action = '../funcs/FaleConosco.asp?IdContato='+ IdContato;
	form.submit();

}

function ValidaFaleConoscoParceiros(){
	var form = document.forms['FaleConosco']
	
	if (form.nome.value == '' || form.nome.value.length < 5){
		alert('Preencha corretamente o campo nome.');
		form.nome.focus();
		return;
	}
	if (form.email.value == '' || form.email.value.indexOf(".") < 2 || form.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o campo e-mail.');
		form.email.focus();
		return;
	}
	if (form.assunto.value == ''){
		alert('Preencha corretamente o campo assunto.');
		form.assunto.focus();
		return;
	}
	 if (form.mensagem.value == ''){
		alert('Preencha corretamente o campo mensagem.');
		form.mensagem.focus();
		return;
	}
	
	form.action = '../funcs/FaleConoscoParceiros.asp';
	form.submit();

}

// ---------- Função flutuante da DIV Aguarde
function DivFlutuante()
{
	var startX = resultado,
	startY = 305;
	var ns = (navigator.appName.indexOf("Netscape") != -1);
	var d = document;
	function ml(id)
	{
		var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.left=x;this.style.top=y;};
		el.x = startX;
		if (verticalpos=="fromtop")
		el.y = startY;
		else{
		el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
		el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft=function()
	{
		if (verticalpos=="fromtop"){
		var pY = ns ? pageYOffset : document.body.scrollTop;
		ftlObj.y += (pY + startY - ftlObj.y)/8;
		}
		else{
		var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
		ftlObj.y += (pY - startY - ftlObj.y)/8;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 10);
	}
	ftlObj = ml("aguarde");
	stayTopLeft();
}

/////////////// Jornal COC On-Line

function AbreMidia(Midia, Tipo){
	if (Tipo == 1){
		window.open('http://www.jornal.coc.com.br/fotos/'+ Midia,'wind','toolbar=no,width=628,height=504,scrollbars=yes,resizable=no');
		return
	}
	if (Tipo == 2){
		//window.open('http://www.jornal.coc.com.br/EventosVideoXML.asp?Video=' + Midia,'video','width=325,height=300,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no')
		window.location.href = 'http://www.jornal.coc.com.br/Fotos/' + Midia;
		return
	}
}

function AbreGaleria(Id, Nome){
	
	window.open('http://www.jornal.coc.com.br/galeria.asp?Id='+ Id +'&Nome='+ Nome,'wind','toolbar=no,width=645,height=553,scrollbars=yes,resizable=no');
	
}

function AbreGaleriaThathi(Id, Nome){
		
	window.open('http://www.jornal.coc.com.br/galeriaThathi.asp?Id='+ Id +'&Nome='+ Nome ,'wind','toolbar=no,width=645,height=544,scrollbars=yes,resizable=no');
	
}


function mostraFotoEducar(arq,alt,lag){
	if(navigator.appName=="Microsoft Internet Explorer")
		window.open(arq,'Condi','fullscreen=0,channelmode=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + alt + ',height=' + lag + ',top=100,left=100');
    else
    	window.open(arq,'Condi','location=0,fullscreen=0,menubar=0,toolbar=0,status=0,screenX=100,screenY=100,resizable=0,scrollbars=1,width=' + alt + ',height=' + lag);
}


/////////////////////////////////

function ValidaSeja(){
	var form = document.forms['form'];
	if (form.nome.value == '' || form.nome.value.length < 5){
		alert('Preencha corretamente o campo nome.');
		form.nome.focus();
		return;
	}
	if (form.mail.value == '' || form.mail.value.indexOf(".") < 2 || form.mail.value.indexOf("@") < 2){
		alert('Preencha corretamente o campo e-mail.');
		form.mail.focus();
		return;
	}
	form.action = 'funcs/EnviaSejaParceiro.asp'
	form.target = "info"
	form.submit();
	
	ancora('emailEnviado')
}

function abre_scroll(arq,alt,lag,res){
	if(navigator.appName=="Microsoft Internet Explorer")
		window.open(arq,'Condi','fullscreen=0,channelmode=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=' + res + ',width=' + lag + ',height=' + alt + ',top=100,left=100');
	else 
		window.open(arq,'Condi','location=0,fullscreen=0,menubar=0,toolbar=0,status=0, scrollbars=1, screenX=100,screenY=100,resizable=' + res + ',width=' + lag + ',height=' + alt);
}

function abre_scroll1(arq,alt,lag,res){
	if(navigator.appName=="Microsoft Internet Explorer")
		window.open(arq,'Condi','fullscreen=0,channelmode=0,toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=' + res + ',width=' + lag + ',height=' + alt + ',top=100,left=100');
	else 
		window.open(arq,'Condi','location=0,fullscreen=0,menubar=0,toolbar=1,status=0, scrollbars=1, screenX=100,screenY=100,resizable=' + res + ',width=' + lag + ',height=' + alt);
}

/* Inicio função hint  ****************************************************************************************/

// Aqui você vai detectar os navegadores


 //  IF = 1 -> Esconde Texto
 //  IF = 2 -> Move o Texto
function Hint(objNome, action, Esquerda, Topo){ 
 	if (bIsIE) {
  		objHint = document.getElementById(objNome);
 	}
	 if (bIsNav) {
  		objHint = document.getElementById(objNome);
  		event = objHint;
 	}
 
 	switch (action){
  		case 1: //Esconde
   			objHint.style.visibility = "hidden";
   		break;
  		case 2: //Move
		   objHint.style.visibility = "visible";
		   objHint.style.left = xmouse - Esquerda;
		   objHint.style.top = ymouse + Topo;
   		break;
 	}		 
}


function RedMenu(){
	document.getElementById("RedMenu").style.height = 1000
	document.getElementById("RedMenu").style.display = 'block'
	document.getElementById("RedMenu").style.display = 'none'
}

function AOLContaReq(pNome,pContador) {
	
	document.getElementById(pContador).value = document.getElementById(pNome).value.length;	
	
	if(document.getElementById(pNome).value.length>300) {
		alert('O Número Máximo de 300 Caracteres foi Excedido!');
		document.getElementById(pNome).value = document.getElementById(pNome).value.substr(0,2999);
	}	
}

function AOLdrawAlert(cb){
		opts = cb.options
		val = opts[opts.selectedIndex].value
		//comentado por Estevão Vilas Boas  11/03/2004
		if(val == 132){
			document.getElementById('DIVData').style.display = "block";
		}
		else{
			document.getElementById('DIVData').style.display = "none";
		}
}

function AOLValidaDia(pCampo) {
	if(document.getElementById(pCampo).value < 1 ||  document.getElementById(pCampo).value > 31 )
	{
		alert('Dia inválido!');
		//document.getElementById(pCampo).focus();		
	}
}

function AOLValidaMes(pCampo) {
	if(document.getElementById(pCampo).value < 1 ||  document.getElementById(pCampo).value > 12 )
	{
		alert('Mês inválido!');
		//document.getElementById(pCampo).focus();
	}
}	

function AOLValidaAno(pCampo) {

	if(document.getElementById(pCampo).value < 1)
	{
		alert('Ano inválido!');
		document.getElementById(pCampo).focus();
		return false
	}
}		

function ValidaAOLReq(pData){

	var form = document.forms['frmAOLReq'];

	
	if (form.txtDetalhe.value == "") {
		alert('Preencha corretamente o texto do Requerimento!');
		form.txtDetalhe.focus();
		return;
	}

	
	if(document.getElementById('cboRequer').value==132) {
		if (form.Dia.value < 1 || form.Dia.value > 31){
		alert('Preencha corretamente o campo Dia!');
		form.Dia.focus();
		return;
		}
	
		if (form.Mes.value < 1 || form.Mes.value > 12){
		alert('Preencha corretamente o campo Mes!');
		form.Mes.focus();
		return;
		}

		if (form.Ano.value < 1){
		alert('Preencha corretamente o campo Ano!');
		form.Ano.focus();
		return;
		}
	}
	
	form.action = 'funcs/AOLRequerimentos.asp'
	form.target = "info"
	//form.document.location = "#emailEnviado"
	form.submit();

}


function ValidaAOLPresencas(){

	var form = document.forms['frmAOLReq'];
	
	if (form.txtDetalhe.value == "") {
		alert('Preencha corretamente o texto do Requerimento!');
		form.txtDetalhe.focus();
		return;
	}

	
	if(document.getElementById('cboRequer').value==132) {
		if (form.Dia.value < 1 || form.Dia.value > 31){
		alert('Preencha corretamente o campo Dia!');
		form.Dia.focus();
		return;
		}
	
		if (form.Mes.value < 1 || form.Mes.value > 12){
		alert('Preencha corretamente o campo Mes!');
		form.Mes.focus();
		return;
		}

		if (form.Ano.value < 1){
		alert('Preencha corretamente o campo Ano!');
		form.Ano.focus();
		return;
		}
	}
	
	form.action = 'funcs/AOLRequerimentos.asp';
	form.target = "info"
	//form.document.location = "#emailEnviado"
	form.submit();

}

function ValidarAOLPresenca() {

	var form = document.forms['frmAOLPresencas'];

	if (form.dataini.value == "") {
		alert('Preencha corretamente o Campo Data Inicial!');
		form.dataini.focus();
		return;
	}
	
	if (form.datafim.value == "") {
		alert('Preencha corretamente o Campo Data Final!');
		form.datafim.focus();
		return;
	}	
	
	//form.action = 'AOLPresencas.asp'
	//form.target = "info"
	//form.document.location = "#emailEnviado"
	//form.submit();
	
	pagina = 'AOLPresencas.asp?dataini='+form.dataini.value+'&datafim='+form.datafim.value+'&empresa='+form.Empresa.value+'&login='+form.Login.value+'&Senha='+form.Senha.value +'&campoNome='+ form.campoNome.value+ '&campoCurso='+ form.campoCurso.value;
	
	CarregarPagina(pagina,'DivAOL',2)
}

function ValidarAOLCartao() {

	var form = document.forms['frmAOLCartao'];

	if (form.txtData.value == "") {
		alert('Preencha corretamente o Campo Data!');
		form.txtData.focus();
		return;
	}
	
	//form.action = 'funcs/AOLPresencas.asp'
	//form.target = "info"
	//form.document.location = "#emailEnviado"
	//form.submit();
	
	pagina = 'AOLCartao.asp?txtData='+form.txtData.value+'&empresa='+form.Empresa.value+'&login='+form.Login.value+'&Senha='+form.Senha.value;
	
	CarregarPagina(pagina,'DivAOL',2)
}


function AOLMudaImg(pImg) {
	
	document.getElementById(pImg).src = 'images/faculdade/AOLMsgLida.gif';
	
}

function AOLMudaImgNew(pImg) {
	
	document.getElementById(pImg).src = '../images/faculdade/AOLMsgLida.gif';
	
}

function ValidarAOLSenha() {

	var form = document.forms['frmSenha'];
	
	if (form.txtSenha.value == "") {
		alert('Campo Senha deve ser Preenchido!');
		form.txtSenha.focus();
		return;
	}
		
	if (form.SenhaAnterior.value != form.txtSenha.value) {
		alert('Senha Anterior Incorreta!');
		return;
	}
			
	if (form.txtNovaSenha.value == "") {
		alert('Preencha corretamente o Campo Nova Senha!');
		form.txtNovaSenha.focus();
		return;
	}
	
	if (form.txtConfirmaSenha.value == "") {
		alert('Preencha corretamente o Confirma Nova Senha!');
		form.txtConfirmaSenha.focus();
		return;
	}
	
	if (form.txtNovaSenha.value != form.txtConfirmaSenha.value) {
		alert('o campo Nova Senha e Confirmação devem ser Iguais!');
		form.txtNovaSenha.focus();
		return;
	}

	form.action = 'funcs/AOLSenha.asp'
	form.target = "info"
	form.submit();
	
	//pagina = 'AOLSenha.asp?txtSenha='+form.txtSenha.value+'&txtNovaSenha='+form.txtNovaSenha.value+'&txtConfirmaSenha='+form.txtConfirmaSenha.value+'&Empresa='+form.Empresa.value+'&Login='+form.Login.value+'&Senha='+form.SenhaAnterior.value;
	//CarregarPagina(pagina,'DivAOL',2)
}

function CalendarioEvento(){

	var f = document.forms['eventos'];
	
	pagina = 'eventos.asp?mese='+ f.mese.value +'&anno='+ f.anno.value
	CarregarPagina(pagina,'principal',2)
}


function ValidaDataRequerimento(pData) {
	
	var form = document.forms['frmAOLReq'];
	
	var Data1,Data2,Dif;
	
	//Faltas...132 = Requerimento de FALTAS...
	if(form.cboRequer.value == 132) {
		//if(form.Ano.value == "" || form.Mes.value == "" || form.Dia.value == "") {
		//	form.Dia.focus;
		//	return;
		//}
		
		Data1 = new Date(pData);
		Data2 = new Date(form.Ano.value+"/"+form.Mes.value+"/"+form.Dia.value);
	
		Dif = Data1 - Data2;
		
		Dif = Dif / 1000 / 60 / 60 / 24;
			
		if(Dif < 2)
			{
				StatusDiv('DivMsg',1);
		}
		else {
			
			StatusDiv('DivMsg',0);
		}
	}
}

function StatusDiv(obj,pStatus){	
	
	var div;
	
	div = obj;
	
	Status = pStatus;
	
	if(Status == 0) {
		document.getElementById(div).style.display = "none";
		document.getElementById('txtDetalhe').style.display = "block";
		document.getElementById('DVCont').style.display = "block";
		document.getElementById('btEnviar').style.display = "block";
		}
	else{
		document.getElementById(div).style.display = "block";
		document.getElementById('txtDetalhe').style.display = "none";
		document.getElementById('DVCont').style.display = "none";
		document.getElementById('btEnviar').style.display = "none";
    	}

}




/*******************************************************

	V E S T I B U L A R   I N F O R M A T I V O S ...

********************************************************/


function Vest_EnviaFacInfo(ID){
	form 		= document.forms['faculdadeAux'];
	AnoNet 		= form.AnoNet.value;

	pagina = 'Vestibulares.asp?AnoNet='+AnoNet;
	
	CarregarPagina(pagina,'principal',1)
}

function Vest_EnviaFacInfo1(ID){
	form 		= document.forms['facAux'];
	AnoNet 		= form.AnoNet.value;

	pagina = 'Vestibulares.asp?AnoNet='+AnoNet;
	
	CarregarPagina(pagina,'principal',1)
}

function Vest_EnviaFacInfo2(ID){
	form 		= document.forms['faculdadeAux'];
	AnoNet 		= form.AnoNet.value;
	CODInst		= form.cod_instituicao.value;
	window.open('coc/VestibularInformativos.asp?AnoNet='+AnoNet+'&cod_instituicao='+CODInst,'Faculdade','toolbar=no,width=680,height=504,scrollbars=yes,resizable=no');
}
function Vest_EnviaFacInfo3(ID){
	form 		= document.forms['facInformativoProc']
	AnoNet 		= form.AnoNet.value
	UNIFAC		= form.UNIFAC.value
	B_UNIFAC	= form.B_UNIFAC.value
	
	pagina = 'Vestibulares.asp?AnoNet='+AnoNet+'&UNIFAC='+UNIFAC+'&B_UNIFAC='+B_UNIFAC
	
	CarregarPagina(pagina,'principal',1)
	
	
}
function Vest_EnviaFacInfo4(ID){
	form 		= document.forms['facInformativoProc']
	AnoNet 		= form.AnoNet.value
	NUMINFO		= form.NUMINFO.value
	B_NUMINFO	= form.B_NUMINFO.value
	
	pagina = 'Vestibulares.asp?AnoNet='+AnoNet+'&NUMINFO='+NUMINFO+'&B_NUMINFO='+B_NUMINFO
	
	
	CarregarPagina(pagina,'principal',1)
	
}
function Vest_EnviaFacInfo5(AnoNet,CODInst){
	window.open('coc/VestibularInformativos.asp?AnoNet='+AnoNet+'&cod_instituicao='+CODInst,'Faculdade','toolbar=no,width=680,height=504,scrollbars=yes,resizable=no');
}

function Vest_EnviaLeitObrig(ID){
	form 		= document.forms['leiAux'];
	Semestre	= form.Semestre.value;

	pagina = 'Vestibulares.asp?Semestre='+Semestre;
	
	CarregarPagina(pagina,'principal',1)
}

function CarregaAOL(IdSite)
{
	form = document.forms['Form_Ao']
	var VCODEmpresa;
	
	if(form.login.value == '')
	{
		alert('Preencha seu login');
		form.login.focus();
		return	
	}
	
	if(form.senha.value == '')
	{
		alert('Preencha sua senha');
		form.senha.focus();
		return	
	}	
	
	if(IdSite==38)
		form.action = 'http://www.coc.com.br/LoginAlunoOnline.asp?IdSite=38'
	else
	{
		if(form.CodEmpresa[0].checked == true){
			IdSite = 2
		}
		if(form.CodEmpresa[1].checked == true){
			IdSite = 20
		}
		
		form.target = '_blank';
		//if(IdSite==2)
			
			form.action = 'alunoOnline/LoginAlunoOnline.asp'
		//if(IdSite==20)
		//	form.action = 'http://www.ceforp.com.br/LoginAlunoOnline.asp'
	}
	form.submit();
}

function ValidarDocente()
{
	form = document.forms['Form_Do']
	
	if(form.usuario.value == '')
	{
		alert('Preencha seu usuario');
		form.usuario.focus();
		return	
	}
	
	if(form.senha.value == '')
	{
		alert('Preencha sua senha');
		form.senha.focus();
		return	
	}	
	
	form.target='_parent';
	form.action = 'docenteOnline/naoLogado.asp?flag=1';
	form.submit();
}

function CarregaAO(IDSite){
	form = document.forms['Form_Ao']
	var VCODEmpresa
	if(form.CodEmpresa[0].checked == true){
		VCODEmpresa = 605
		form.IDSite.value = 2
		form.pagina.value = 'AlunoOnLine.asp?Login='+form.login.value+'&Senha='+form.senha.value+'&CodEmpresa='+VCODEmpresa
	}
	if(form.CodEmpresa[1].checked == true){
		VCODEmpresa = 215
		form.IDSite.value = 20
		form.pagina.value = 'AlunoOnLine.asp?Login='+form.login.value+'&Senha='+form.senha.value+'&CodEmpresa='+VCODEmpresa
	}

	if (VCODEmpresa == 605 && IDSite == 2){
		if(IDSite == 2){
			CarregarPagina('AlunoOnLine.asp?Login='+form.login.value+'&Senha='+form.senha.value+'&CodEmpresa='+VCODEmpresa,'principal',2)
			form.reset();
			return
		}
	}
	if (VCODEmpresa == 215 && IDSite == 20){
		if(IDSite == 20){
			CarregarPagina('AlunoOnLine.asp?Login='+form.login.value+'&Senha='+form.senha.value+'&CodEmpresa='+VCODEmpresa,'principal',2)
			form.reset();
			return
		}
	}
	if(VCODEmpresa = 605)
		form.action = 'http://www.faculdadescoc.com.br/Default.asp'
	else
		form.action = 'http://www.ceforp.com.br/Default.asp'
	form.submit()
	
	//s = setInterval('ResetarForm("Form_Ao")', 50)
}

function LimpaForm(obj){
	
	s = setInterval('ResetarForm("'+ obj +'")', 50)	
	
}

function ResetarForm(obj){

	f = document.forms[obj];
	f.reset();
	
	clearInterval(s);
	
}


function tremer(n) {
	if(navigator.appName=="Microsoft Internet Explorer"){		
		if (self.moveBy) {
			for (i = 3; i > 0; i--) {
				for (j = n; j > 0; j--) {
					self.moveBy(0,i);
					self.moveBy(i,0);
					self.moveBy(0,-i);
					self.moveBy(-i,0);
				}
			}
		}
	}
}

function numero(event) {

	var ValidChar = "#0;#9;#8;#48;#49;#50;#51;#52;#53;#54;#55;#56;#57;";
	
	if(navigator.appName.indexOf("Netscape")!= -1)
		tecla = event.which; 
	else
		tecla = event.keyCode;
		
	if (ValidChar.indexOf("#" + String(tecla + ";")) == -1)
		return false;
	else	
		return true;
	
}

//Função para Validar as inscrições para o Congresso Conectado
function ValidaInscricaoCongresso(){
	
	var f = document.forms['form'];

	if(f.nome.value == ''){
		alert('Preencha o nome!');
		f.nome.focus();
		return;
	}
	
	if (f.email.value == '' || f.email.value.indexOf(".") < 2 || f.email.value.indexOf("@") < 2){
		alert('Preencha corretamente o email.');
		f.email.focus();
		return;
	}
	
	if(f.razaosocial.value == ''){
		alert('Preencha a Razão Social da Escola!');
		f.razaosocial.focus();
		return;
	}
	
	if(f.fantasia.value == ''){
		alert('Preencha o Nome Fantasia da Escola!');
		f.fantasia.focus();
		return;
	}

	if(f.cidade.value == ''){
		alert('Preencha o Nome da Cidade!');
		f.cidade.focus();
		return;
	}	
		
	if(f.fone1.value == ''){
		alert('Preencha o Prefixo do Telefone!');
		f.fone1.focus();
		return;
	}
	
	if(f.fone2.value == ''){
		alert('Preencha o Número do Telefone!');
		f.fone2.focus();
		return;
	}
	
	f.target = 'info';
	f.action = 'funcs/CadastroCongresso.asp';
	f.submit();

}



function valida_cnpj(cnpj) { 
      var numeros, digitos, soma, i, resultado, pos, tamanho, digitos_iguais; 
      digitos_iguais = 1; 
      if (cnpj.length < 14 && cnpj.length < 15) 
            return false; 
      for (i = 0; i < cnpj.length - 1; i++) 
            if (cnpj.charAt(i) != cnpj.charAt(i + 1)) 
                  { 
                  digitos_iguais = 0; 
                  break; 
                  } 
      if (!digitos_iguais) 
            { 
            tamanho = cnpj.length - 2 
            numeros = cnpj.substring(0,tamanho); 
            digitos = cnpj.substring(tamanho); 
            soma = 0; 
            pos = tamanho - 7; 
            for (i = tamanho; i >= 1; i--) 
                  { 
                  soma += numeros.charAt(tamanho - i) * pos--; 
                  if (pos < 2) 
                        pos = 9; 
                  } 
            resultado = soma % 11 < 2 ? 0 : 11 - soma % 11; 
            if (resultado != digitos.charAt(0)) 
                  return false; 
            tamanho = tamanho + 1; 
            numeros = cnpj.substring(0,tamanho); 
            soma = 0; 
            pos = tamanho - 7; 
            for (i = tamanho; i >= 1; i--) 
                  { 
                  soma += numeros.charAt(tamanho - i) * pos--; 
                  if (pos < 2) 
                        pos = 9; 
                  } 
            resultado = soma % 11 < 2 ? 0 : 11 - soma % 11; 
            if (resultado != digitos.charAt(1)) 
                  return false; 
            return true; 
            } 
      else 
            return false; 
} 


function numero(event) {

var ValidChar = "#0;#9;#8;#48;#49;#50;#51;#52;#53;#54;#55;#56;#57;";

	if(navigator.appName.indexOf("Netscape")!= -1)
		tecla = event.which; 
	else
		tecla = event.keyCode;
		
	if (ValidChar.indexOf("#" + String(tecla + ";")) == -1)
		return false;
	else	
		return true;
	
}


function HabilitaCampo(campo, valor)
{
	
	if(valor == 'outros')
	{
		document.getElementById(campo).style.display = "block";
	}
	else
	{
		document.getElementById(campo).style.display = "none";
	}
}


function ENCJS(str){
    return escape(str)
  }

  function UNENCJS(str){
    return unescape(str)
  }
