// JavaScript Document

	var w3c = (document.getElementById) ? 1:0
	var ns4 = (document.layers) ? 1:0  //browser detect for NS4 & W3C standards	
	var hasCookies = false;

  // tests whether the user accepts cookies, and sets a flag.
  if(document.cookie == '') {
    document.cookie = 'hasCookies=yes';
    if (document.cookie.indexOf('hasCookies=yes') != -1) hasCookies = true;
  }
  else hasCookies = true;
  
  // sets a cookie in the browser.
  function setCookie (name, value, hours, path) {
    if (hasCookies) {
  	  if(hours) {
  	    if ( (typeof(hours) == 'string') && Date.parse(hours) ) var numHours = hours;
  	    else if (typeof(hours) == 'number') var numHours = (new Date((new Date()).getTime() + hours*3600000)).toGMTString();
  	  }
  	document.cookie = name + '=' + escape(value) + ((numHours)?(';expires=' + numHours):'') + ((path)?';path=' + path:'');
    }
  }
  
  	// swaps text in a layer.
	function swapText(text, divID, innerDivID) {
		var content = "<span class=\"commandDesc\">" + text + "</span>";
		if (w3c) {
			var theObj = getObject(divID);
			if (theObj) theObj.innerHTML = text;
		}
    else if (ns4) {
			var innerObj = divID + ".document." + innerDivID;
			var theObj = getObject(innerObj);
			if (theObj) {
				theObj.document.open();
				theObj.document.write(content);
				theObj.document.close();
			}
		}
	}
  
  // reads a cookie from the browser
  function readCookie(name) {
    if (document.cookie == '') return '';
    else {
    	var firstChar, lastChar;
    	var theBigCookie = document.cookie;
    	firstChar = theBigCookie.indexOf(name);
    	if (firstChar != -1) {
    	    firstChar += name.length + 1;
    	    lastChar = theBigCookie.indexOf(';', firstChar);
    	    if (lastChar == -1) lastChar = theBigCookie.length;
    	    return unescape(theBigCookie.substring(firstChar, lastChar));
    	}
      else return '';
    }
  }  
  
function showHideModuleMouseOver(divID) {
    	var theCookie = readCookie(divID);
		if ((theCookie=="e") || (theCookie=="")) 
		{
			window.status="Esconder";
		}
		else
		{
			window.status="Exibir";
		}
 }
    
function showHideModule(divID) {
	var state = toggleFoldyPersistState(divID);
	var ok=false;
	if(w3c) {
		var divIDobj = MM_findObj(divID);
		if(divIDobj != null) {
			ok=true;
			if(state=="c") {
					divIDobj.style.display = "none";
				} else {
					divIDobj.style.display = "";
				}
			}
		}
	
		
	if(!ok){
		document.location = document.location;
	}
		
	showHideModuleMouseOver(divID);
	//window.status = '';
}
	function toggleFoldyPersistState(divID) {
		var theCookie = readCookie(divID);
		var state="e";
		if ((theCookie == "e") || (theCookie == "")) {
			state="c";
		}
		setCookie(divID,state,'Wed 01 Jan 2020 00:00:00 GMT','/');
		return state;
	}
	
	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;
	}
	
	// Testa um email no formato teste@testando. + com.br (3.2) ou + .com (3) ou + .br (2) //
	// NÃO podem comecar com numeros. Antes da @ podem contar numeros letras, pontos e undescore //
	// O Dominio pode conter caracteres e numeros porem os seus sufixos apenas caracteres //
	function validaemail(email) {
	  var objRegExp  = /^[A-Za-z]([\w\.]*)@([A-Za-z0-9\.]*)\.(([A-Za-z]{3}\.[A-Za-z]{2}$)|([A-Za-z]{3}$)|([a-z]{2}$))/i ;
	  return objRegExp.test(email);
	}
	
	
	/************************************************
	* function verificaCPF
	* Verifica se um CPF é válido
	* Input: cpf a ser verificado
	************************************************/
	function verificaCPF(cpf) {
    var dac = "", inicio = 2, fim = 10, soma, digito, i, j
			
		if (cpf.length > 11)
			return false;
			
	    for (j=1;j<=2;j++) {
	    	soma = 0;
	        for (i=inicio;i<=fim;i++)
	        	soma += parseInt(cpf.substring(i-j-1,i-j))*(fim+1+j-i);

			if (j == 2) 
				soma += 2 * digito;
	                
			digito = (10 * soma) % 11;
	            
			if (digito == 10) 
				digito = 0;
	                
			dac += digito;
	        inicio = 3;
	        fim = 11;
		}
			
		if ((cpf == '00000000000') || (cpf == '11111111111') || (cpf == '22222222222') || 
			(cpf == '33333333333') || (cpf == '44444444444') || (cpf == '55555555555') || 
			(cpf == '66666666666') || (cpf == '77777777777') || (cpf == '88888888888') || 
			(cpf == '22233366638') || (cpf == '99999999999') || (cpf == '22233366638') || 
			(cpf == '12345678900'))
			return false;
			
		return (dac == cpf.substring(cpf.length-2,cpf.length));
	}
	
	
  function carregaBrowser(titulo,propiedades){
  	window.open('',titulo,propiedades);
	}	
<!--
/*function atualizaStatus(){
Data = new Date()
Hora=Data.getHours()
Minuto=Data.getMinutes()
Segundos=Data.getSeconds()
Dia=Data.getDate()
Mes=Data.getMonth()+1
Ano=Data.getYear()
if (Dia<10) Dia="0"+Dia
if (Mes<10) Mes="0"+Mes
if (Hora<10) Hora="0"+Hora
if (Minuto<10) Minuto="0"+Minuto
if (Segundos<10) Segundos="0"+Segundos

window.defaultStatus="www.netkids.com.br - "+Dia+"/"+Mes+"/"+Ano+" - "+Hora+":"+Minuto+":"+Segundos
}
setInterval(atualizaStatus,1000)*/
-->

	