 function MM_reloadPage(init) {  //reloads the window if Nav4 resized 
  if (init==true) with (navigator) {
     if((appName=="Netscape")&&(parseInt(appVersion)==4)) { 
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; 
        onresize=MM_reloadPage;
	  }
  } 
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) 
location.reload(); 
} 
MM_reloadPage(true);

		function mOvr(src, clrOver)
		{
		 if (!src.contains(event.fromElement))
		 {
		  src.style.cursor = 'hand';
		  src.bgColor = clrOver;
		 }
		}
		                                                                                                                                                             
		function mOut(src, clrIn)
		{
		 if (!src.contains(event.toElement))
		 {
		  src.style.cursor = 'default';
		  src.bgColor = clrIn;
		 }
		}

		function mClk(src, tgt)
		{
		 if (tgt == '_self') window.open(src);
		 else document.location = src;
		}

        if (navigator.appName == "Netscape"){          
            if(navigator.appVersion < "5"){ 
               layerRef="document.layers"; 
               styleSwitch=""; 
               visibleVar="show";    
               ab="[" 
               fc="]"             
            }else{ 
               layerRef="document.getElementById"; 
               styleSwitch=".style"; 
               visibleVar="visible"; 
               ab="(" 
               fc=")"                      
            }          
        } else {           
         layerRef="document.all"; 
         styleSwitch=".style"; 
         visibleVar="visible"; 
         ab="[" 
         fc="]" 
      } 

function ShowLayerM(qual){        
       eval(layerRef+ab+'"'+qual+'"'+fc+styleSwitch+'.visibility=visibleVar'); 
       eval(layerRef+ab+'"esconde"'+fc+styleSwitch+'.visibility=visibleVar');  
       eval(layerRef+ab+'"'+qual+'"'+fc+styleSwitch+'.display=""'); 
      } 

function HideLayerM(qual){        
       eval(layerRef+ab+'"'+qual+'"'+fc+styleSwitch+'.visibility="hidden"'); 
      } 
	  
function HideAll(){         
			eval(layerRef+ab+'"div01"'+fc+styleSwitch+'.visibility="hidden"'); 
     } 


function popupprivacidade(){
	window.open('/homepage/privacidade.asp','janela','scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width=610,height=420');
}

function valida_cpf() {

     var Form, URL, resposta, s;
     Form = document.Inscricao;
     URL = document.URL.toString();


     if (Form.cpf.value.length == 0) {
	alert("O CPF é um campo obrigatório !");
        Form.cpf.focus();
        return false;
     }
     s = limpa_string(Form.cpf.value);
     // checa se é cpf
     if (s.length == 11) {
	if (checa_CPF(Form.cpf.value) == false ) {
           alert("O CPF não é válido !");
           Form.cpf.focus();
           return false;
	}
     }
     else {
        alert("O CPF não é válido !");
        return false;
     }
     

     return true;
}
function limpa_string(S){
// Deixa so' os digitos no numero
var Digitos = "0123456789";
var temp = "";
var digito = "";
    for (var i=0; i<S.length; i++){
      digito = S.charAt(i);
      if (Digitos.indexOf(digito)>=0){temp=temp+digito}
    }
    return temp
}
function checa_CPF(s)
{
	var i;
	s = limpa_string(s);
	var c = s.substr(0,9);
	var dv = s.substr(9,2);
	var d1 = 0;
	for (i = 0; i < 9; i++)
	{
		d1 += c.charAt(i)*(10-i);
	}
        if (d1 == 0) return false;
	d1 = 11 - (d1 % 11);
	if (d1 > 9) d1 = 0;
	if (dv.charAt(0) != d1)
	{
		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)
	{
		return false;
	}
        return true;
}



function valida_numeros(s)
{
	var i; 
	var dif = 0;
	for (i = 0; i < s.length; i++)
	{
		var c = s.charAt(i);
		if (!((c >= "0") && (c <= "9")))
		{
			dif = 1;
		}
	}
	if (dif == 1)
	{
		return false;
	}
	return true;
}

