﻿//*****************************************************************************
//Objetivo:					Encapsular funcionalidades do Menu 
//Data:						05/05/2004
//Autor:					Marcelo Pacheco
//Data Ultima alteração:	
//Motivo:					
//Autor:
//*****************************************************************************
//*****************************************************************************
// DECLARAÇÃO DAS VARIÁVEIS
//*****************************************************************************
var objDocXmlDom		// Instancia do componente Microsoft.XMLDOM
var objElemento         // Objeto Xml
var strDoc;				// Recebe path
var strId;				// id do objeto
var objEl;				// Objeto selecionado
var strItemMenu;		// Composição do id do objeto
var strAux;				// Composição do id do objeto
var intMax;				// Numero de subitens de menu
var intInd;				// Variavel usada no laço for
var arrPagina;			// Array Menu principal
var arrSubMenuPagina;	// Array Menu interno nas páginas
var gstrRetMenu;		// retorno mennu
var gstrRetSubMenu;		// retorno Sub menu
var arrNomeMes			// Array com o nome dos meses
var dtnData				// Data
var intQdadeMenu		// Quantidade de Menu
var intCountI			// Variavel utilizada no laço for
var intTotal			// total 
var objIE				// Verifica Brower IE
var objNS6				// Verifica Brower NetScape
var objCrossobj			// Objeto div
var intTempx			// Posição horizontal temporaria do evento dragDrop
var intTempy			// Posição horizontal temporaria do evento dragDrop
var intPgyoffset		// Posição na página
var intPageXOffset		// Posição na página


/******************************************************************************
/ Objetivo  : Instancia o objeto xmldom para ler o xml
/ Premissas : Nenhuma
/ Entradas  : strId id do objeto a ser extraido o xml correspondente
/ Retorno   : Nenhum
/******************************************************************************/  
function Initialize()
{
	var strDoc =  "/InstSites/RespSocial/InstDados/MenuRespSocial.xml"
	var strNomePagina = new String('') // Recebe nome da página
	arrPagina = new Array();
	arrSubMenuPagina = new Array();
	objDocXmlDom = new ActiveXObject("Microsoft.XMLDOM");
	objDocXmlDom.async=false;
	objDocXmlDom.load(strDoc)
	objElemento = objDocXmlDom.getElementsByTagName("MENU");

	intQdadeMenu = objElemento.length -1
	
	intTotal = 0
	for (intCountJ=0;intCountJ<objElemento.length;intCountJ++)
	{
		for (intCount=0;intCount<objElemento(intCountJ).childNodes.length;intCount++)
		{
			strNomePagina = objElemento(intCountJ).childNodes(intCount).attributes(1).value; 
			arrPagina[intCount] = strNomePagina.substr(strNomePagina.lastIndexOf('\/') + 1);
			for (intCountI=0;intCountI<objElemento(intCountJ).childNodes(intCount).childNodes.length;intCountI++)	
			{
				
				strNomePagina = objElemento(intCountJ).childNodes(intCount).childNodes(intCountI).attributes(1).value;
				arrSubMenuPagina[intTotal] = strNomePagina.substr(strNomePagina.lastIndexOf('\/') + 1);
				intTotal++ 
			}
		}
	}
}
Initialize()


//============================================================================================
// objetivo........: Seleciona o menu que aparecera aberto em determinada página
// Premissas.......:
// Entradas........: 
// Retorno.........:
//============================================================================================	
function SelecionaMenu()
{
	var strUrl = window.location.href; // Recebe url
	var strPagina = new String(strUrl.substr(strUrl.lastIndexOf('\/') + 1)); // Pega o nome da página
	var strId		// id do objeto			
	var strCompara	// compara o nome da pagina com a url
	var intAux // Variavel usada no laço for
	
	for (intAux=0;intAux<=arrPagina.length;intAux++)
	{
		if(strPagina.indexOf(arrPagina[intAux]) && strPagina!="" && gstrRetMenu!="" && gstrRetSubMenu!="")
		{
			checkExpand(intQdadeMenu,gstrRetMenu);
			//document.getElementById('a'+gstrRetMenu).style.color = "white";
			document.getElementById(gstrRetSubMenu).style.color = "silver";
			break;
		}
	}

}
//============================================================================================
// objetivo........: Abre e Fecha do Menu 
// Premissas.......:
// Entradas........: intCatalogo quantidade de itens do menu
//				   : objNome nome do objeto 
// Retorno.........:
//============================================================================================	
function checkExpand(intCatalogo,objNome) 
{ 
	ComprimeMenu(intCatalogo,objNome); 

		strId = objNome + "Sub";
		objEl = document.getElementById(strId);
		
//		document.getElementById('a'+strId.substr(0,strId.indexOf("S"))).style.color = "white";
		if (null!=objEl) objEl.style.display = "none" == objEl.style.display ? "" : "none" 
			
			return (false);
		
}
//============================================================================================
// objetivo........: Função comprime Menu
// Premissas.......:
// Entradas........:	intCatalogo
// Retorno.........:
//============================================================================================
function ComprimeMenu(intCatalogo,objNome) 
{ 
        var strItemMenu = "";		// composiçao do nome do submenu
        var strAux = "I";			// Variavel auxiliar para incremento do submenu
        var intMax = intCatalogo;	// Numero de menu	
        var intInd;					// Variavel usada no laço for
		
		for(intInd=1;intInd<=intMax;intInd++) 
        { 
                strItemMenu = objNome.substring(0,1) + strAux + "Sub"; 
                document.getElementById(strItemMenu).style.display = "none"; 
				//document.getElementById('a'+strItemMenu.substr(0,strItemMenu.indexOf("S"))).style.color = "gray";
                strAux = strAux + "I"; 
	            
        }
}
//============================================================================================
// objetivo........: Função submeform
// Premissas.......:
// Entradas........:	strDestino,	// Destino da página
//				   :    strMenu,	// nome menu
//				   :    strSubMenu	// nome submenu
// Retorno.........:
//============================================================================================
function submenteForm(strDestino, strMenu, strSubMenu, strTarget, intPos, intPopup)
{

	if (strTarget == '_self'){
		if  (strDestino.indexOf("http://")==-1){
			document.frmMenu.hdnPos.value = intPos
			document.frmMenu.target = strTarget;
			document.frmMenu.action = strDestino;
			document.frmMenu.hdnMenuID.value = strMenu;
			document.frmMenu.hdnSubMenuID.value = strSubMenu;
			document.frmMenu.submit();
		}
		else{
			window.open(strDestino,strTarget);
		}
	}
	else if (intPopup == 1){
		AbreUrl(window.location.href.substring(0,window.location.href.substring(7).indexOf('/',0)+7).toString() + strDestino, 'Intranet', '650', '500', '0', '0', '0', '1', '0', '0', '0')
	}
	else{
		window.open(strDestino,strTarget);
	}
}
/******************************************************************************************
/ Objetivo  : Abrir browser aceitando personalização o usuário
/ Premissas : 
/ Entradas  : strUrl - Url da página que será aberta
/ 			: strPopup - Identificação da da janela que será aberta
/ 			: intLargura - Largura da janela
/ 			: intAltura - Altura da janela
/ 			: intLocation - Exibir / Ocultar barra de endereços
/ 			: intMenubar - Exibir / Ocultar menu de opções
/ 			: intResizable - Exibir / Ocultar opção de redimensionamento
/ 			: intScrollbars - Exibir / Ocultar barras de rolagem
/ 			: intStatus - Exibir / Ocultar barra de status
/ 			: intTitlebar - Exibir / Ocultar barra de título
/ 			: intToolbar - Exibir / Ocultar barra de ferramentas
/ Retorno   : Nenhum
/******************************************************************************************/
function AbreUrl(strUrl, strPopup, intLargura, intAltura, intLocation, intMenubar, intResizable, intScrollbars, intStatus, intTitlebar, intToolbar)
{
	if(parseInt(intLargura) == 0){intLargura = screen.availWidth;};
	if(parseInt(intAltura) == 0){intAltura = screen.availHeight;};
	
	if(intLargura > 1 && intAltura > 1)
	{
		var intDistEsq = (screen.availWidth - intLargura) / 2;			//Distancia esquerda da janela aberta
		var intDistTop = (screen.availHeight - intAltura) / 2;			//Distancia direita da janela aberta
	}
	else
	{
		var intLargura = screen.availWidth - 10;						//Distancia esquerda da janela aberta
		var intAltura = screen.availHeight - 28;						//Distancia direita da janela aberta
		var intDistEsq = 0;												//Distancia esquerda da janela aberta
		var intDistTop = 0;												//Distancia direita da janela aberta
	}
	
	window.open(strUrl,strPopup,'menubar=' + (parseInt(intLocation) == 0 ? 'no':'yes') + ',menubar=' + (parseInt(intMenubar) == 0 ? 'no':'yes') + ',resizable=' + (parseInt(intResizable) == 0 ? 'no':'yes') + ',scrollbars=' + (parseInt(intScrollbars) == 0 ? 'no':'yes') + ',status=' + (parseInt(intStatus) == 0 ? 'no':'yes') + ',titlebar=' + (parseInt(intTitlebar) == 0 ? 'no':'yes') + ',toolbar=' + (parseInt(intToolbar) == 0 ? 'no':'yes') + ',width=' + intLargura + ',height=' + intAltura + ',top=' + intDistTop + ',left=' + intDistEsq);
}

//============================================================================================
// objetivo........: Função abre janela popup
// Premissas.......:
// Entradas........:
// Retorno.........:
//============================================================================================
<!--
//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com
objIE=document.all		
objNS6=document.getElementById&&!document.all
var strMessage=""; // Mensagem
//============================================================================================
// objetivo........: Função abre janela popup
// Premissas.......:
// Entradas........:
// Retorno.........:
//============================================================================================

function clickIE()
{
	if (document.all) 
	{
		(strMessage);return false;
	}
}
 
/***********************************************
* Image Thumbnail viewer- © Dynamic Drive (www.dynamicdrive.com)
* Last updated Sept 26th, 03'. This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
function ietruebody()
{
	return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body
}
/*******************************************************************************************
 Objetivo   : Valida entrada de dados para a pesquisa na lista telefônica
 Premissas  : Nenhuma premissa
 Efeitos    : Nenhum efeito
 Entradas   : strValor:		Campo de pesquisa
 Retorno    : ( true / false )
*******************************************************************************************/
function pesquisaGeral(strValor)
{
	var	intTam;			//Valida tamanho do critério de pesquisa
	var	strLetraPesq;	//Verifica entrada de dados
	var intCont;		//Variável auxiliar
	
	strValor = document.getElementById('txtCampo').value;
	intTam = strValor.length;
	strLetraPesq = strValor.charAt(0);
	intCont = 0;
		
	if(intTam < 3)
	{ 
		alert('Digite texto para pesquisa com no minimo 3 letras !');
		document.all("txtCampo").focus();
		return;
	}
	
	for(intCont=0;intCont<intTam;intCont++)
		if(strValor.charAt(intCont) == '&'){
			alert('Por favor, nao utilze na pesquisa o caracter \"&\"' )
			document.all("txtCampo").value = '';
			document.all("txtCampo").focus();
			return;
		}
	
	document.all("txtCampo").value = '';
	document.all("txtCampo").focus();
	
	window.location.href='/LT/main.asp?txtValorPesquisa='+ strValor;
}
/*******************************************************************************************
 Objetivo :	Submeter página ao pressionar a tecla ENTER
 Entradas :	txtCampo   - Objeto a ser tratado
			intTeclado - Contém valor do KeyCode 
 Saídas :	Valor tratado
*******************************************************************************************/
function ValidaPesquisa(txtCampo,intTeclado)
{
	if (intTeclado.keyCode==13)
	{
		pesquisaGeral(txtCampo.value); // função de validação de dados
		return false;
	}
	else
	{
		return true;
	}	
}
/******************************************************************************************
/ Objetivo  : Confirma se o usuário que abrir o pdf e abre o arquivo
/ Premissas : 
/ Entradas  : strNomeArquivo - Nome do arquivo
/ Retorno   : Nenhum
/******************************************************************************************/
function AbrirPDF(strNomeArquivo)
{
	//if ( confirm(strMsg) )
		{window.open(strNomeArquivo,'pdffile','resizable=yes,scrollbars=yes,width=700,height=500,top=10,left=5');}
}

//============================================================================================
// objetivo........: Função comprime Menu
// Premissas.......:
// Entradas........:	intCatalogo
// Retorno.........:
//============================================================================================
function ComprimeMenuSeta(intCatalogo,objNome) 
{ 
        var strItemMenu = "";		// composiçao do nome do submenu
        var strAux = "I";			// Variavel auxiliar para incremento do submenu
        var intMax = intCatalogo;	// Numero de menu	
        var intInd;					// Variavel usada no laço for
		
		
		for(intInd=1;intInd<=intMax;intInd++) 
        { 
                strItemMenu = objNome.substring(0,1) + strAux + "Sub"; 
                document.getElementById(strItemMenu).style.display = "none"; 
                document.getElementById(objNome.substr(0,1)+strAux).style.backgroundImage = "url('/InstImagem/Seta.gif')";
				
                strAux = strAux + "I"; 
	            
        }
}
	
//============================================================================================
// objetivo........: Função destaca item do Menu
// Premissas.......:
// Entradas........:
// Retorno.........:
//============================================================================================
function DestacaItemMenu()
{
		var strUrl = window.location.href; // Recebe url
		var strPagina = new String(strUrl.substr(strUrl.lastIndexOf('\/') + 1)); // Pega o nome da página

		if(strPagina.indexOf("Papeis") != -1)
		{
			strPagina = "Papeis.asp"
		}
		else if (strPagina.indexOf("Normas") != -1)
		{
			strPagina = "Normas.asp"
		}
		
		document.getElementById('a'+strPagina.substr(0,strPagina.indexOf("."))).style.color="#82B51E"
}
	

//============================================================================================
// objetivo........: MouseOver
// Premissas.......:
// Entradas........:
// Retorno.........:
//============================================================================================

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




/* função duplicada, não apagar até a publicação por Revisão estiver ok, qualquer dúvida falar com Cristiane Habiro*/

//*****************************************************************************
//Objetivo:					Encapsular funcionalidades do Envio de Email
//Autor:					Marcelo Pacheco
//Data:						12/05/2004
//Autor:					Flávio Almeida
//Data Ultima alteração:	16/06/2005
//Motivo:					-
// Alterado por:			Cristiane Habiro (7COMm)
// Data: 					24/04/2006
// Motivo da Alteração: 	Validação do campo e-mail

//*****************************************************************************

//*****************************************************************************
// DECLARAÇÃO DAS VARIÁVEIS
//*****************************************************************************
//============================================================================================
// objetivo........: Função valida form
// Premissas.......:
// Entradas........:	objFrm objeto form
// Retorno.........:
//============================================================================================
function Validaform(objFrm)
{
	var intAux	// Variavel usada no laço for
	var intVerifica	// Variavel de controle de validação
	intVerifica = 1
	for (intAux=0;intAux<objFrm.length;intAux++)
	{
		if (objFrm[intAux].type.indexOf("text")!=-1)
		{
			if(document.getElementById(objFrm[intAux].id).value == "")
			{
				alert("Campo "+objFrm[intAux].id.substring(3)+" Obrigatório");
				document.getElementById(objFrm[intAux].id).focus();
				intVerifica = 0;
				break;
			}			
			if(objFrm[intAux].name.indexOf('txtEmail')!=-1 && objFrm[intAux].value != "")
			{
				if(ValidarEmail(objFrm[intAux].value) != true	)
				{
					alert(objFrm[intAux].name.substr(3) + " inválido.");
					objFrm[intAux].focus();
					intVerifica = 0;
					break;
				}
			}
		}
	}	
	if (intVerifica == 1)
		objFrm.submit()
}

//============================================================================================
// objetivo........: Função valida form
// Premissas.......:
// Entradas........:	objFrm objeto form
// Retorno.........:
//============================================================================================
function ValidaFormIngles(objFrm)
{
	var intAux	// Variavel usada no laço for
	var intVerifica	// Variavel de controle de validação
	intVerifica = 1
	for (intAux=0;intAux<objFrm.length;intAux++)
	{
		if (objFrm[intAux].type.indexOf("text")!=-1)
		{
			if(document.getElementById(objFrm[intAux].id).value == "")
			{
				alert("Field "+objFrm[intAux].id.substring(3)+" Required!");
				document.getElementById(objFrm[intAux].id).focus();
				intVerifica = 0;
				break;
			}
			if(objFrm[intAux].name.indexOf('txtEmail')!=-1 && objFrm[intAux].value != "")
			{
				if(ValidarEmail(objFrm[intAux].value) != true	)
				{
					alert("Invalid " + objFrm[intAux].name.substr(3) + ".");
					objFrm[intAux].focus();
					intVerifica = 0;
					break;
				}
			}			
		}
	}	
	if (intVerifica == 1)
		objFrm.submit()
}

//*****************************************************************************
//Objetivo:					Encapsular funcionalidades Desafio Bovespa
//Autor:					Camila D. Silva 
//Data:						03/08/2006
//Autor:					
//Data Ultima alteração:	
//Motivo:					

//*****************************************************************************

//*****************************************************************************
//Objetivo:					Validar os dados do formulário
//Entradas:					objForm - Objeto Form
//Saída:					Nenhuma
//*****************************************************************************		
function ValidaForm(objForm)
{
	
	var intCont = 0; //Contador auxiliar
	var strMsgErro = ''; //Mensagem de erro
	
	if ((objForm.optEscola[0].checked == false) && (objForm.optEscola[1].checked == false)){
		alert("Por favor, selecione a ESCOLA");
		objForm.optEscola[0].focus();
		return false;
	}
	if (objForm.txtNomeEscola.value == ""){
		alert("Por favor, preencha o campo NOME DA ESCOLA");
		objForm.txtNomeEscola.focus();
		return false;
	}
	
	if (objForm.txtEnderecoEscola.value == ""){
		alert("Por favor, preencha o campo ENDEREÇO");
		objForm.txtEnderecoEscola.focus();
		return false;
	}
	
	if (objForm.txtBairroEscola.value == ""){
		alert("Por favor, Preencha o campo BAIRRO");
		objForm.txtBairroEscola.focus();
		return false;
	}
	if (objForm.cboCidade.selectedIndex == 0){
		alert("Por favor, selecione a CIDADE");
		objForm.cboCidade.focus();
		return false;
	}
	if (objForm.txtCepEscola1.value == ""){
		alert("Por favor, preencha o campo CEP");
		objForm.txtCepEscola1.focus();
		return false;
	}
	if (objForm.txtCepEscola2.value == ""){
		alert("Por favor, preencha o campo CEP");
		objForm.txtCepEscola2.focus();
		return false;
	}
	if (objForm.txtDDDTelEscola.value == ""){
		alert("Por favor, preencha o campo DDD");
		objForm.txtDDDTelEscola.focus();
		return false;
	}
	if (objForm.txtTelEscola.value == ""){
		alert("Por favor, preencha o campo Telefone");
		objForm.txtTelEscola.focus();
		return false;
	}
	//if (objForm.txtDDDFaxEscola.value == ""){
		//alert("Por favor, preencha o campo DDD");
		//objForm.txtDDDFaxEscola.focus();
		//return false;
	//}
	//if (objForm.txtFaxEscola.value == ""){
		//alert("Por favor, preencha o campo Fax");
		//objForm.txtFaxEscola.focus();
		//return false;
	//}
	if (objForm.txtEmailEscola.value == "")
	{
		alert("Por Favor preencha o campo E-mail da escola.");
		objForm.txtEmailEscola.focus();
		return false;
	}
	if (!ValidarEmail(objForm.txtEmailEscola.value)){
		alert("E-mail inválido.");
		objForm.txtEmailEscola.focus();
		return false;								
	}
	if (objForm.txtAluno01.value == ""){
		alert("A equipe deve ter, no mínimo, 3 alunos.");
		objForm.txtAluno01.focus();
		return false;
	}
	if (objForm.txtEmailAluno01.value == "")
	{
		alert("Por Favor preencha o campo E-mail do aluno 01.");
		objForm.txtEmailAluno01.focus();
		return false;
	}
	if (!ValidarEmail(objForm.txtEmailAluno01.value)){
		alert("E-mail inválido.");
		objForm.txtEmailAluno01.focus();
		return false;								
	}
	else if  (objForm.cboAnoAluno01.value==0)
	{
		alert("Selecione o ano que está cursando.");
		objForm.cboAnoAluno01.focus();
		return false;
	}
	
	if (objForm.txtAluno02.value == ""){
		alert("A equipe deve ter, no mínimo, 3 alunos.");
		objForm.txtAluno02.focus();
		return false;
	}
	if (objForm.txtEmailAluno02.value == "")
	{
		alert("Por Favor preencha o campo E-mail do aluno 02.");
		objForm.txtEmailAluno02.focus();
		return false;
	}
	if (!ValidarEmail(objForm.txtEmailAluno02.value)){
		alert("E-mail inválido.");
		objForm.txtEmailAluno02.focus();
		return false;								
	}
	else if  (objForm.cboAnoAluno02.value==0)
	{
		alert("Selecione o ano que está cursando.");
		objForm.cboAnoAluno02.focus();
		return false;
	}

	if (objForm.txtAluno03.value == ""){
		alert("A equipe deve ter, no mínimo, 3 alunos.");
		objForm.txtAluno03.focus();
		return false;
	}
	
	if (objForm.txtEmailAluno03.value == "")
	{
		alert("Por Favor preencha o campo E-mail do aluno 03.");
		objForm.txtEmailAluno03.focus();
		return false;
	}
	if (!ValidarEmail(objForm.txtEmailAluno03.value)){
		alert("E-mail inválido.");
		objForm.txtEmailAluno03.focus();
		return false;								
	}
	
	else if  (objForm.cboAnoAluno03.value==0)
	{
		alert("Selecione o ano que está cursando.");
		objForm.cboAnoAluno03.focus();
		return false;
	}
		
	if (objForm.txtAluno04.value != ""){
		if  (objForm.txtEmailAluno04.value=="")
		{
			alert("Informe o e-mail");
			objForm.txtEmailAluno04.focus();
			return false;
		}
		if (!ValidarEmail(objForm.txtEmailAluno04.value)){
			alert("E-mail inválido.");
			objForm.txtEmailAluno04.focus();
			return false;								
		}
		if  (objForm.cboAnoAluno04.selectedIndex==0)
		{
			alert("Selecione o ano que está cursando.");
			objForm.cboAnoAluno04.focus();
			return false;
		}
	}
	if (objForm.txtAluno05.value != ""){
		if  (objForm.txtEmailAluno05.value=="")
		{
			alert("Informe o e-mail");
			objForm.txtEmailAluno05.focus();
			return false;
		}
		if (!ValidarEmail(objForm.txtEmailAluno05.value)){
			alert("E-mail inválido.");
			objForm.txtEmailAluno05.focus();
			return false;								
		}
		if  (objForm.cboAnoAluno05.selectedIndex==0)
		{
			alert("Selecione o ano que está cursando.");
			objForm.cboAnoAluno05.focus();
			return false;
		}
	}

	
	if (objForm.txtAluno05.value != ""){
		if  (objForm.cboAnoAluno05.value==0)
		{
			alert("Selecione o ano que está cursando.");
			objForm.cboAnoAluno05.focus();
			return false;
		}
	}
	
	if (objForm.txtProfessorOrientador.value == ""){
		alert("Por favor, preencha o campo NOME DO PROFESSOR ORIENTADOR");
		objForm.txtProfessorOrientador.focus();
		return false;
	}
    if (objForm.txtCPFProfessor.value == ""){
		alert("Por favor, preencha o campo CPF DO PROFESSOR ORIENTADOR");
		objForm.txtCPFProfessor.focus();
		return false;
	}
	if (!ValidaCPF(objForm.txtCPFProfessor.value)){
		alert("CPF inválido.");
		objForm.txtCPFProfessor.focus();
		return false;								
	}
	if (objForm.txtEmailProfessor.value == ""){
		alert("Por favor, preencha o campo E-MAIL DO PROFESSOR ORIENTADOR");
		objForm.txtEmailProfessor.focus();
		return false;
	}
	if (!ValidarEmail(objForm.txtEmailProfessor.value)){
		alert("E-mail do professor orientador inválido.");
		objForm.txtEmailProfessor.focus();
		return false;								
	}
	if (objForm.txtDiretorEscola.value == ""){
		alert("Por favor, preencha o campo NOME DO DIRETOR DA ESCOLA");
		objForm.txtDiretorEscola.focus();
		return false;
	}
	if (objForm.txtEmailDiretorEscola.value == ""){
		alert("Por favor, preencha o campo E-MAIL DO DIRETOR DA ESCOLA");
		objForm.txtEmailDiretorEscola.focus();
		return false;
	}
	if (!ValidarEmail(objForm.txtEmailDiretorEscola.value)){
		alert("E-mail do diretor da escola inválido.");
		objForm.txtEmailDiretorEscola.focus();
		return false;								
	}
	if ((objForm.optEscola[0].checked == true)){
	    if (objForm.txtDiretoriaEnsino.value == ""){
			alert("Por favor, preencha o campo DIRETORIA DE ENSINO");
		    objForm.txtDiretoriaEnsino.focus();
		    return false;
	    }
	    if (objForm.txtEmailDiretoriaEnsino.value == ""){
			alert("Por favor, preencha o campo E-MAIL DA DIRETORIA DE ENSINO");
		    objForm.txtEmailDiretoriaEnsino.focus();
		    return false;
	    }
	}
		
	for (intCont == 0; intCont < objForm.length; intCont++)
	{	
		if (objForm[intCont].id.indexOf('Aluno') != -1)
		{
			if (objForm[intCont].value != '')
			{
				if ((objForm[intCont].value.substr(0,1) == objForm[intCont].value.substr(1,1)) && (objForm[intCont].value.substr(1,1) == objForm[intCont].value.substr(2,1)))
				{
					alert('Por favor, preencha o campo  NOME DO ALUNO corretamente');
					strMsgErro = strMsgErro + objForm[intCont].name.toString;
					objForm[intCont].focus();
					break;
				}
			}
		}
	}
	
	if (strMsgErro == '')
	{
		objForm.submit();
	}
}
//*****************************************************************************
//Objetivo:					Limpar os dados do formulário
//Entradas:					objForm - Objeto Form
//Saída:					Nenhuma
//*****************************************************************************		
function LimparCampo(objForm)
{
	try
	{
		if (objForm.txtAluno04.value == "")
		{
			objForm.cboAnoAluno04.value=0;
		}
		if (objForm.txtAluno05.value == "")
		{
			objForm.cboAnoAluno05.value=0;
		}
	}
	catch(objEx)
	{
		alert(objEx.toString());
	}
}

/******************************************************************************************
/ Objetivo  : Abrir página da Galeria de Fotos
/ Premissas : 
/ Entradas  : 
/ 			: 
/ Retorno   : 
/******************************************************************************************/

function Galeria()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioBovespa.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}
	
function Galeria2()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioBovespa_211006.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}	

function Galeria3()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioBovespa_251106.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}

function Galeria4()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioBovespa_091206.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}
	
function Galeria5()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioEliminatoria.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}

function Galeria6()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioEliminatoria2.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}
	
function Galeria7()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafio3.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}
	
function Galeria8()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioEliminatoria4.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}	
	
function Galeria9()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioEliminatoria5.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}	
	
function Galeria10()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioEliminatoria6.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}	
function Galeria11()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioEliminatoria7.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}	
function Galeria12()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioEliminatoria8.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}	
function Galeria13()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioEliminatoria9.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}	
function Galeria14()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioEliminatoria10.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}	
	function Galeria15()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioEliminatoria11.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}	
	function Galeria16()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioEliminatoria12.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}	
	
	function Galeria17()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioEliminatoria13.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}	
	
	function Galeria18()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioEliminatoria14.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}	

	function Galeria19()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioEliminatoria15.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}	
	
	function Galeria20()
	{
		var h = (screen.height - 400) / 2;
		var w = (screen.width - 600) / 2;
		
		window.open('/InstSites/DesafioBovespa/GaleriaDesafioEliminatoria16.asp','Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=600,height=400,top=' + h + ',left=' + w);
	}	
