
function over2(oElmt){oElmt.style.backgroundColor = "#f7db01";oElmt.style.color = "#000000";oElmt.style.textDecoration = "none";}
function out2(oElmt){oElmt.style.backgroundColor = "#1637b2";oElmt.style.color = "#ffffff";oElmt.style.textDecoration = "none";}

function show1(){document.all.janelinha1.style.display = "block";}
function hide1(){document.all.janelinha1.style.display = "none";}

function show2(){document.all.janelinha2.style.display = "block";}
function hide2(){document.all.janelinha2.style.display = "none";}

function show3(){document.all.janelinha3.style.display = "block";}
function hide3(){document.all.janelinha3.style.display = "none";}


function validacnpj(Campo){
var i;
var Valida=true;
var s = Campo;
var c = s.substr(0,12);
var dv = s.substr(12,2);
var d1 = 0;
for (i = 0; i < 12; i++){d1 += c.charAt(11-i)*(2+(i % 8));}
if (d1 == 0) Valida=false;
d1 = 11 - (d1 % 11);
if (d1 > 9) d1 = 0;
if (dv.charAt(0) != d1){Valida=false;}
d1 *= 2;
for (i = 0; i < 12; i++){d1 += c.charAt(11-i)*(2+((i+1) % 8));}
d1 = 11 - (d1 % 11);
if (d1 > 9) d1 = 0;
if (dv.charAt(1) != d1){Valida=false;}
return Valida; 
}

function validacpf(Campo){  
if (Campo != ""){
	var i; 
	var Valida=true;  
	s = Campo;
	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){Valida=false;}  
	d1 = 11 - (d1 % 11);  
	if (d1 > 9) d1 = 0;  
	if (dv.charAt(0) != d1){Valida=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){Valida=false;} 
	return Valida; 
	} 
} 


function validaemail(pStr){
if (pStr != ""){
	reEmail = /^[\w!#$%&*+\/=?^`{|}~-]+(\.[\w!#$%&*+\/=?^`{|}~-]+)*@(([\w-]+\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
	if (reEmail.test(pStr) && pStr.length>0) {return true;} else{return false;}
	}
}


function validadata(pStr)
{
	if (pStr != ""){	
	reDate = /^\d{2}\/\d{2}\/\d{4}$/;
		if (reDate.test(pStr) && pStr.length>0) {
			if(parseInt(pStr.substring(0,2))<=31 && parseInt(pStr.substring(3,5))<=12 && parseInt(pStr.substring(6,10))<=2050 && parseInt(pStr.substring(6,10))>=1900 )
			{return true;}else{return false;}
		} else{return false;}
	}	
} 

function numeros(pStr){
if (pStr != ""){	
	var reTipo = /^\d+$/;
	return reTipo.test(pStr);}
}	

function numerosDecimal(pStr)
{
	if (pStr != ""){	
		if (pStr.indexOf(",") != "-1") {
		var reTipo = /^(\d+|\d{1,3}(\.\d{3})+)\,\d{1}$/; 
		}
		else {
		var reTipo = /^\d+$/;
		}
		return reTipo.test(pStr);
		
	}	
}

function valorDecimal(pStr)
{
	if (pStr != ""){	
		if (pStr.indexOf(",") != "-1") {
		var reTipo = /^(\d+|\d{1,3}(\.\d{3})+)\,\d{2}$/; 
		}
		else {
		var reTipo = /^\d+$/;
		}
		return reTipo.test(pStr);
		
	}	
}