function Verifica_CPF(formulario) {
	// Fonte: http://www.construindoseusite.com.br/javascript/scripts/js_validacao_cpf_imp.htm

	var CPF = formulario.cpf.value; // Recebe o valor digitado no campo

	// Aqui começa a checagem do CPF
	var POSICAO, I, SOMA, DV, DV_INFORMADO;
	var DIGITO = new Array(10);
	DV_INFORMADO = CPF.substr(9, 2); // Retira os dois últimos dígitos do número informado

	// Desemembra o número do CPF na array DIGITO
	for (I=0; I<=8; I++) {
	  DIGITO[I] = CPF.substr( I, 1);
	}

	// Calcula o valor do 10º dígito da verificação
	POSICAO = 10;
	SOMA = 0;
	   for (I=0; I<=8; I++) {
		  SOMA = SOMA + DIGITO[I] * POSICAO;
		  POSICAO = POSICAO - 1;
	   }
	DIGITO[9] = SOMA % 11;
	   if (DIGITO[9] < 2) {
			DIGITO[9] = 0;
	}
	   else{
		   DIGITO[9] = 11 - DIGITO[9];
	}

	// Calcula o valor do 11º dígito da verificação
	POSICAO = 11;
	SOMA = 0;
	   for (I=0; I<=9; I++) {
		  SOMA = SOMA + DIGITO[I] * POSICAO;
		  POSICAO = POSICAO - 1;
	   }
	DIGITO[10] = SOMA % 11;
	   if (DIGITO[10] < 2) {
			DIGITO[10] = 0;
	   }
	   else {
			DIGITO[10] = 11 - DIGITO[10];
	   }

	// Verifica se os valores dos dígitos verificadores conferem
	DV = DIGITO[9] * 10 + DIGITO[10];
   if (DV != DV_INFORMADO) {
	  return false;
   }

	if (CPF == '11111111111'){
		return false;
	}
	if (CPF == '22222222222'){
		return false;
	}
	if (CPF == '33333333333'){
		return false;
	}
	if (CPF == '44444444444'){
		return false;
	}
	if (CPF == '55555555555'){
		return false;
	}
	if (CPF == '66666666666'){
		return false;
	}
	if (CPF == '77777777777'){
		return false;
	}
	if (CPF == '88888888888'){
		return false;
	}
	if (CPF == '99999999999'){
		return false;
	}
	if (CPF == '00000000000'){
		return false;
	}
	
	return true;
}

// Valida se o campo apenas tem numeros
function checkNumber(evt) {
    evt = (evt) ? evt : window.event;
    var charCode = (evt.which) ? evt.which : evt.keyCode;
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        status = "Este campo aceita apenas números.";
        return false;
    }
    status = "";
    return true;
}

// Valida se o campo apenas tem numeros e caracteres 
// usados para informar o telefone. Ex: (41)9679.9074
function checkPhone(evt) {
    evt = (evt) ? evt : window.event;
    var charCode = (evt.which) ? evt.which : evt.keyCode;
    if (charCode > 31 && (charCode < 32 || charCode > 57)) {
        status = "Este campo aceita apenas números.";
        return false;
    }
    status = "";
    return true;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function envia_form_buscaArtigo()
{
	document.buscaArtigo.Ok.disabled = "true";
	document.buscaArtigo.Ok.value = "...";

	return true;
}
function quebra_frame()
{
  if (top.location != location) {
    top.location.href = document.location.href ;
  }
}
function voltar()
{
window.self.history.go(-1);
}
function envia_form_busca()
{

	if (document.busca.palavraBusca.value == "" || document.busca.palavraBusca.value.length<2){
	   alert ("Informe a palava para efetuar a busca.");
	   document.busca.palavraBusca.focus();
	   return false;
	}

	return true;
}
function testa_file()
{
alert("Clique no botão \"Procurar\" para informar o nome do arquivo.");
return false;
}
function pop_up(pagina,nome_pagina,largura,altura,rolagem) {
// Este script mostra um pop-up no meio da página do visitante  
  // Variaveis da página 
        
  var posLargura = (screen.width / 2) - (largura / 2); 
  var posAltura  = (screen.height / 2) - (altura / 2); 

  var propriedades = 'toolbar=no,';          // retira a barra de  
                                             //   trabalho 
  propriedades    += 'location=no,';         // retira a barra de 
                                             //   localização 
  propriedades    += 'directories=no,';      // retira a barra de  
                                             //   diretorios 
  propriedades    += 'status=no,';           // retira a barra de  
                                             //   status 
  propriedades    += 'menubar=no,';          // retira a barra de  
                                             //   menu 

if (rolagem == 0){
   propriedades    += 'scrollbars=no,';      // retira as barras  
                                             //   de rolagem 
}else{
   propriedades    += 'scrollbars=yes,';      // retira as barras  
                                             //   de rolagem 
}

  propriedades    += 'resizable=no,';        // retira a opção de  
                                             //   reescalagem da janela 
  propriedades    += 'width='+largura+',';   // largura da janela 
  propriedades    += 'height='+altura+',';   // altura da janela 
  propriedades    += 'left='+posLargura+','; // posição inicial  
                                             //   horizontal da janela 
  propriedades    += 'top='+posAltura;       // posição inicial  
                                             //   vertical da janela  
  window.open(pagina, nome_pagina, propriedades); 

}
function goToURL(URL) { window.location = URL; }
function mOvr(src,clrOver) {
	if (!src.contains(event.fromElement)) {
	  src.style.cursor = 'default';
	  src.bgColor = clrOver;
	}
}
function mOut(src,clrIn) {
	if (!src.contains(event.toElement)) {
	  src.style.cursor = 'default';
	  src.bgColor = clrIn;
	}
}
function mClk(src) {
	if(event.srcElement.tagName=='TD'){
	  src.children.tags('A')[0].click();
	}
}
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_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_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];}
}
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

/**
 * This array is used to remember mark status of rows in browse mode
 */
var marked_row = new Array;


/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object    the table row
 * @param   interger  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 3.3 ... Opera changes colors set via HTML to rgb(r,g,b) format so fix it
    if (currentColor.indexOf("rgb") >= 0) 
    {
        var rgbStr = currentColor.slice(currentColor.indexOf('(') + 1,
                                     currentColor.indexOf(')'));
        var rgbValues = rgbStr.split(",");
        currentColor = "#";
        var hexChars = "0123456789ABCDEF";
        for (var i = 0; i < 3; i++)
        {
            var v = rgbValues[i].valueOf();
            currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
        }
    }

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
            // Garvin: deactivated onclick marking of the checkbox because it's also executed
            // when an action (like edit/delete) on a single item is performed. Then the checkbox
            // would get deactived, even though we need it activated. Maybe there is a way
            // to detect if the row was clicked, and not an item therein...
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = true;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = true;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = false;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function

/*
 * Sets/unsets the pointer and marker in vertical browse mode
 *
 * @param   object    the table row
 * @param   interger  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 *
 * @author Garvin Hicking <me@supergarv.de> (rewrite of setPointer.)
 */
function setVerticalPointer(theRow, theRowNum, theAction, theDefaultColor1, theDefaultColor2, thePointerColor, theMarkColor) {
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;

    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        domDetect    = false;
    } // end 3

    var c = null;
    // 5.1 ... with DOM compatible browsers except Opera
    for (c = 0; c < rowCellsCnt; c++) {
        if (domDetect) {
            currentColor = theCells[c].getAttribute('bgcolor');
        } else {
            currentColor = theCells[c].style.backgroundColor;
        }

        // 4. Defines the new color
        // 4.1 Current color is the default one
        if (currentColor == ''
            || currentColor.toLowerCase() == theDefaultColor1.toLowerCase()
            || currentColor.toLowerCase() == theDefaultColor2.toLowerCase()) {
            if (theAction == 'over' && thePointerColor != '') {
                newColor              = thePointerColor;
            } else if (theAction == 'click' && theMarkColor != '') {
                newColor              = theMarkColor;
                marked_row[theRowNum] = true;
            }
        }
        // 4.1.2 Current color is the pointer one
        else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
                 && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
            if (theAction == 'out') {
                if (c % 2) {
                    newColor              = theDefaultColor1;
                } else {
                    newColor              = theDefaultColor2;
                }
            }
            else if (theAction == 'click' && theMarkColor != '') {
                newColor              = theMarkColor;
                marked_row[theRowNum] = true;
            }
        }
        // 4.1.3 Current color is the marker one
        else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
            if (theAction == 'click') {
                newColor              = (thePointerColor != '')
                                      ? thePointerColor
                                      : ((c % 2) ? theDefaultColor1 : theDefaultColor2);
                marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                      ? true
                                      : null;
            }
        } // end 4

        // 5. Sets the new color...
        if (newColor) {
            if (domDetect) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            }
            // 5.2 ... with other browsers
            else {
                theCells[c].style.backgroundColor = newColor;
            }
        } // end 5
    } // end for

     return true;
 } // end of the 'setVerticalPointer()' function

/**
 * Checks/unchecks all tables
 *
 * @param   string   the form name
 * @param   boolean  whether to check or to uncheck the element
 *
 * @return  boolean  always true
 */
 function isEmpty(text){
   var enter1 = "\n",
       enter2 = "\r",
       espaco = " ",
       tab = "\t";

   if (text =="") return true;
   if (text ==0) return true;

   //A verifica se o caracter selecionada possui valor vahlido
   for (var indice = 0; indice < text.length; indice++){
      if (text.charAt(indice) != espaco && 
         text.charAt(indice) != tab &&
         text.charAt(indice) != enter1 && 
         text.charAt(indice) != enter2 )
         return false;
   }
   return true;
}
function envia_form_webmail()
{

	if (isEmpty(document.webmail.webmail_usuario.value)){
	   alert ("Informe o Usuário");
	   document.webmail.webmail_usuario.focus();
	   return false;
	}
	if (isEmpty(document.webmail.webmail_senha.value)){
	   alert ("Informe Senha");
	   document.webmail.webmail_senha.focus();
	   return false;
	}

	document.webmail.userid.value = document.webmail.webmail_usuario.value;
    document.webmail.password.value = document.webmail.webmail_senha.value; 

	return true;
}

function envia_form_fale_conosco()
{

	teste = null;
	for(i=0; i < document.fale_conosco.RelacaoUNIFIN.length; i++) {
	   if(document.fale_conosco.RelacaoUNIFIN[i].checked) {
		  teste = document.fale_conosco.RelacaoUNIFIN[i].value;
	   }
	}
	if (teste == null) {
	   alert ("Selecione \"Qual a sua relação com a UNIFIN?\"");
	   return false;
	}

	if (document.fale_conosco.Nome.value == ""){
	   alert ("Campo Nome não está preenchido");
	   document.fale_conosco.Nome.focus();
	   return false;
	}
	if (document.fale_conosco.Email.value == ""){
	   alert ("Campo E-mail não está preenchido");
	   document.fale_conosco.Email.focus();
	   return false;
	}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.fale_conosco.Email.value))){ 
	   alert ("Por favor, informe um E-mail válido");
	   document.fale_conosco.Email.focus();   
	   return false;
	}
	if (document.fale_conosco.Telefone.value == ""){
	   alert ("Campo Telefone não está preenchido");
	   document.fale_conosco.Telefone.focus();
	   return false;
	}

	if (document.fale_conosco.Mensagem.value == ""){
	   alert ("Campo Mensagem não está preenchido");
	   document.fale_conosco.Mensagem.focus();
	   return false;
	}

	document.fale_conosco.Enviar.disabled = "true";
	document.fale_conosco.Enviar.value = "Enviando...";

	return true;
}
function envia_form_buscaProf()
{
	document.buscaProf.Ok.disabled = "true";
	document.buscaProf.Ok.value = "...";

	return true;
}
function envia_form_vestibular_inscricao()
{

	if (isEmpty(document.vestibular_inscricao.nome.value)){
	   alert ("Campo Nome não está preenchido");
	   document.vestibular_inscricao.nome.focus();
	   return false;
	}

	if (document.vestibular_inscricao.dia.selectedIndex == 0){
	   alert ("Campo Dia não está preenchido");
	   document.vestibular_inscricao.dia.focus();
	   return false;
	}

	if (document.vestibular_inscricao.estado.selectedIndex == 0){
	   alert ("Campo Estado não está preenchido");
	   document.vestibular_inscricao.estado.focus();
	   return false;
	}

	if (document.vestibular_inscricao.ano.selectedIndex == 0){
	   alert ("Campo Ano não está preenchido");
	   document.vestibular_inscricao.ano.focus();
	   return false;
	}

	if (isEmpty(document.vestibular_inscricao.num_identidade.value)){
	   alert ("Campo Núm. de Identidade não está preenchido");
	   document.vestibular_inscricao.num_identidade.focus();
	   return false;
	}

	if (document.vestibular_inscricao.num_identidade.value.length < 6 || document.vestibular_inscricao.num_identidade.value.length > 11){
	   alert ("O Núm. de Identidade não é válido");
	   document.vestibular_inscricao.num_identidade.focus();
	   return false;
	}

	if (isEmpty(document.vestibular_inscricao.cpf.value)){
	   alert ("Campo CPF não está preenchido");
	   document.vestibular_inscricao.cpf.focus();
	   return false;
	}

	if (Verifica_CPF(vestibular_inscricao) == false){
	   alert ("O CPF informado não é válido");
	   document.vestibular_inscricao.cpf.focus();
	   return false;
	}

	if (isEmpty(document.vestibular_inscricao.endereco_residencial.value)){
	   alert ("Campo Endereço Residencial não está preenchido");
	   document.vestibular_inscricao.endereco_residencial.focus();
	   return false;
	}

	if (isEmpty(document.vestibular_inscricao.bairro.value)){
	   alert ("Campo Bairro não está preenchido");
	   document.vestibular_inscricao.bairro.focus();
	   return false;
	}

	if (isEmpty(document.vestibular_inscricao.cep.value)){
	   alert ("Campo CEP não está preenchido");
	   document.vestibular_inscricao.cep.focus();
	   return false;
	}

	if (isEmpty(document.vestibular_inscricao.cidade.value)){
	   alert ("Campo Cidade não está preenchido");
	   document.vestibular_inscricao.cidade.focus();
	   return false;
	}

	if (document.vestibular_inscricao.estado.selectedIndex == 0){
	   alert ("Campo Estado não está preenchido");
	   document.vestibular_inscricao.estado.focus();
	   return false;
	}

	if (isEmpty(document.vestibular_inscricao.fone_residencial.value)){
	   alert ("Campo Fone Residencial ou de Contato não está preenchido");
	   document.vestibular_inscricao.fone_residencial.focus();
	   return false;
	}

	if (isEmpty(document.vestibular_inscricao.email.value)){
	   alert ("Campo E-mail não está preenchido");
	   document.vestibular_inscricao.email.focus();
	   return false;
	}

	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.vestibular_inscricao.email.value))){ 
	   alert ("Por favor, informe um E-mail válido");
	   document.vestibular_inscricao.email.focus();   
	   return false;
	}

	lingua_estrangeira = null;
	for(i=0; i < document.vestibular_inscricao.lingua_estrangeira.length; i++) {
	   if(document.vestibular_inscricao.lingua_estrangeira[i].checked) {
		  lingua_estrangeira = document.vestibular_inscricao.lingua_estrangeira[i].value;
	   }
	}
	if (lingua_estrangeira == null) {
	   alert ("Selecione a Língua Estrangeira");
	   return false;
	}

	opcao_1 = null;
	for(i=0; i < document.vestibular_inscricao.opcao_1.length; i++) {
	   if(document.vestibular_inscricao.opcao_1[i].checked) {
		  opcao_1 = document.vestibular_inscricao.opcao_1[i].value;
	   }
	}
	if (opcao_1 == null) {
	   alert ("Selecione a 1ª opção de curso");
	   return false;
	}


	opcao_2 = null;
	for(i=0; i < document.vestibular_inscricao.opcao_2.length; i++) {
	   if(document.vestibular_inscricao.opcao_2[i].checked) {
		  opcao_2 = document.vestibular_inscricao.opcao_2[i].value;
	   }
	}
	if (opcao_2 == null) {
	   alert ("Selecione a 2ª opção de curso");
	   return false;
	}

	if (opcao_1 == opcao_2) {
	   alert ("Selecione a 2ª opção de curso difernte da 1ª opção");
	   return false;
	}

	document.vestibular_inscricao.Enviar.disabled = "true";
	document.vestibular_inscricao.Enviar.value = "Enviando...";

	return true;
}

function envia_form_vestibular_novo_boleto()
{

	if (isEmpty(document.novo_boleto.num_identidade.value)){
	   alert ("Campo Núm. de Identidade não está preenchido");
	   document.novo_boleto.num_identidade.focus();
	   return false;
	}

	document.novo_boleto.Enviar.disabled = "true";
	document.novo_boleto.Enviar.value = "Enviando...";

	return true;
}

function envia_form_artigo()
{

	if (isEmpty(document.forms[0].Titulo.value)){
		alert ("Atenção!\nO campo Título é de preenchimento obrigatório.");
		document.forms[0].Titulo.focus();
		return false;
	}

	if (isEmpty(document.forms[0].PalavraChave1.value)){
		alert ("Atenção!\nO campo Palavra-Chave 1 é de preenchimento obrigatório.");
		document.forms[0].PalavraChave1.focus();
		return false;
	}

	if (isEmpty(document.forms[0].PalavraChave2.value)){
		alert ("Atenção!\nO campo Palavra-Chave 2 é de preenchimento obrigatório.");
		document.forms[0].PalavraChave2.focus();
		return false;
	}

	if (isEmpty(document.forms[0].PalavraChave3.value)){
		alert ("Atenção!\nO campo Palavra-Chave 3 é de preenchimento obrigatório.");
		document.forms[0].PalavraChave3.focus();
		return false;
	}

	if (isEmpty(document.forms[0].PalavraChave4.value)){
		alert ("Atenção!\nO campo Palavra-Chave 4 é de preenchimento obrigatório.");
		document.forms[0].PalavraChave4.focus();
		return false;
	}

	if (isEmpty(document.forms[0].PalavraChave5.value)){
		alert ("Atenção!\nO campo PalavraChave 5 é de preenchimento obrigatório.");
		document.forms[0].PalavraChave5.focus();
		return false;
	}

	//document.forms[0].Salvar.disabled = "true";
	//document.forms[0].Salvar.value = "Salvando os dados...";

	return true;
}


function envia_form_calendario()
{
	if (isEmpty(document.forms[0].DtCalendarioIni.value)){
		alert ("Atenção!\nO campo Data Inicial é de preenchimento obrigatório.");
		document.forms[0].DtCalendarioIni.focus();
		return false;
	}

	if (isEmpty(document.forms[0].DtCalendarioFim.value)){
		alert ("Atenção!\nO campo Data Final é de preenchimento obrigatório.");
		document.forms[0].DtCalendarioFim.focus();
		return false;
	}

	if (isEmpty(document.forms[0].Descricao.value)){
		alert ("Atenção!\nO campo Descrição é de preenchimento obrigatório.");
		document.forms[0].Descricao.focus();
		return false;
	}

	//document.forms[0].Salvar.disabled = "true";
	//document.forms[0].Salvar.value = "Salvando os dados...";

	return true;
}

function envia_form_imprensa()
{

	if (isEmpty(document.forms[0].dataPublicacao.value)){
	   alert ("Campo Data de Publicação não está preenchido");
	   document.forms[0].dataPublicacao.focus();
	   return false;
	}
	if (isEmpty(document.forms[0].Titulo.value)){
	   alert ("Campo Título não está preenchido");
	   document.forms[0].Titulo.focus();
	   return false;
	}

	if (isEmpty(document.forms[0].Veiculo.value)){
	   alert ("Campo Veículo não está preenchido");
	   document.forms[0].Veiculo.focus();   
	   return false;
	}

	//document.forms[0].Salvar.disabled = "true";
	//document.forms[0].Salvar.value = "Salvando os dados...";

	return true;
}

function envia_form_noticia()
{

	if (isEmpty(document.forms[0].dataPublicacao.value)){
	   alert ("Campo Data de Publicação não está preenchido");
	   document.forms[0].dataPublicacao.focus();
	   return false;
	}
	if (isEmpty(document.forms[0].dataExpiracao.value)){
	   alert ("Campo Data de Expiração não está preenchido");
	   document.forms[0].dataExpiracao.focus();
	   return false;
	}

	if (isEmpty(document.forms[0].Titulo.value)){
	   alert ("Campo Título não está preenchido");
	   document.forms[0].Titulo.focus();
	   return false;
	}

	if (isEmpty(document.forms[0].Resumo.value)){
	   alert ("Campo Resumo não está preenchido");
	   document.forms[0].Resumo.focus();   
	   return false;
	}


	return true;
}


function envia_form_buscaProf()
{

document.buscaProf.Ok.disabled = "true";
document.buscaProf.Ok.value = "...";

return true;
}

function envia_form_professor()
{

	if (isEmpty(document.forms[0].Nome.value)){
	   alert ("Campo Nome não está preenchido");
	   document.forms[0].Nome.focus();
	   return false;
	}

	if (document.forms[0].IdTitulacao.options[0].selectedIndex == 0){
	   alert ("Escolha uma Titulação para o professor");
	   document.forms[0].IdTitulacao.focus();
	   return false;
	}
	if (isEmpty(document.forms[0].AreaTitulacao.value)){
	   alert ("Campo Área da Titulação não está preenchido");
	   document.forms[0].AreaTitulacao.focus();
	   return false;
	}

	return true;
}

function envia_form_usuario_alterar_senha()
{

	senha_atual = document.forms[0].senha_atual.value;
	if (isEmpty(senha_atual)){
	   alert ("É obrigatório informar uma Senha Atual.");
	   document.forms[0].senha_atual.focus();
	   return false;
	}

	nova_senha = document.forms[0].nova_senha.value;
	if (isEmpty(nova_senha)){
	   alert ("É obrigatório informar a Nova Senha.");
	   document.forms[0].nova_senha.focus();
	   return false;
	}

	nova_senha_repetida = document.forms[0].nova_senha_repetida.value;
	if (isEmpty(nova_senha_repetida)){
	   alert ("É obrigatório repetir a Nova Senha.");
	   document.forms[0].nova_senha_repetida.focus();
	   return false;
	}

	if (nova_senha != nova_senha_repetida){
	   alert ("A Nova Senha Repetida é diferente da Nova Senha informada.");
	   document.forms[0].nova_senha_repetida.value = "";
	   document.forms[0].nova_senha_repetida.focus();
	   return false;
	}

	document.forms[0].Salvar.disabled = "true";
	document.forms[0].Salvar.value = "Salvando...";

	return true;
}

function envia_form_vestibular_enviar_email()
{

	if (document.forms[0].candidatos_inscricoes_pagas.checked == false && document.forms[0].candidatos_inscricoes_n_pagas.checked == false && document.forms[0].candidatos_inscricoes_aprovados.checked == false && document.forms[0].candidatos_inscricoes_suplentes.checked == false)
	{
	   alert ("É obrigatório selecionar pelo menos 1 tipo de destinatário");
	   return false;
	}

	if (isEmpty(document.forms[0].assunto.value)){
	   alert ("Campo Assunto não está preenchido");
	   document.forms[0].assunto.focus();
	   return false;
	}
	
	//document.forms[0].Enviar.disabled = "true";
	//document.forms[0].Enviar.value = "Enviando E-mail...";

	return true;
}
function envia_form_vestibular_edicoes()
{
	if (isEmpty(document.forms[0].Ano.value) || isEmpty(document.forms[0].Semestre.value)){
	   alert ("Campo Edição não está preenchido");
	   document.forms[0].Ano.focus();
	   return false;
	}

	return true;
}
