function Correio(codigo){
	window.open("http://websro.correios.com.br/sro_bin/txect01$.QueryList?Z_START=1&P_ITEMCODE="+codigo+"&P_LINGUA=001&P_COD_UNI="+codigo+"&P_TIPO=001", "Address", "resizable=yes,scrollbars=yes,status=0,resizable=0,width=550,height=400");
	}
	
function BOLETO(buy){
	window.open("./boleto/gera_boleto.asp?compra="+buy);
}

function Exibe(){
	document.getElementById("exibe").style.display='';
	document.getElementById("oculta").style.display='none';
}
function Oculta(){
	document.getElementById("exibe").style.display='none';
	document.getElementById("oculta").style.display='';
}

function INDQ(theForm){
	if(theForm.nome.value==""){
		alert("Insira o Nome!");
		theForm.nome.focus();
		return false;	}
	if(theForm.nome.value=='Nome'){
		alert("Insira o Nome!");
		theForm.nome.focus();
		return false;	}
	if(theForm.email.value==""){
		alert("Insira o E-mail!");
		theForm.email.focus();
		return false;	}
	if(theForm.email.value=='E-mail'){
		alert("Insira o E-mail!");
		theForm.email.focus();
		return false;	}
	if(theForm.snome.value==""){
		alert("Insira seu nome!");
		theForm.snome.focus();
		return false;	}
	if(theForm.semail.value==""){
		alert("Insira seu E-mail!");
		theForm.semail.focus();
		return false;	}
}

function TALK(theForm){
	if(theForm.nome.value==""){
		alert("Insira seu Nome");
		theForm.nome.focus();
		return false;	}
	if(theForm.nome.value=="Nome"){
		alert("Insira seu Nome");
		theForm.nome.focus();
		return false;	}
	if(theForm.email.value==""){
		alert("Insira seu e-mail de contato!");
		theForm.email.focus();
		return false;	}
	if(theForm.email.value=="E-mail"){
	   alert("Insira seu e-mail de contato!");
	   theForm.email.focus();
	   return false;	}
	if(theForm.tell.value==""){
	   alert("Insira um telefone de contato!");
	   theForm.tell.focus();
	   return false;	}
	if(theForm.msg.value==""){
		alert("Deixe sua Mensagem!");
		theForm.msg.focus();
		return false;	}
}

function Register(theForm){
	if(theForm.nome.value==""){
		alert("Digite seu nome corretamente!");
		theForm.nome.focus();
		return false;	}
	if(theForm.email.value==""){
		alert("Digite seu e-mail corretamente!");
		theForm.email.focus();
		return false;	}
	if(theForm.cpf.value==""){
		alert("Digite seu CPF!");
		theForm.cpf.focus();
		return false;	}
	if(theForm.tel.value==""){
		alert("Digite seu Telefone!");
		theForm.tel.focus();
		return false;	}
	if(theForm.nasc.value==""){
		alert("Digite sua data de nascimento!");
		theForm.nasc.focus();
		return false;	}}
		
function RegisterPWS(theForm){
	if(theForm.senha.value==""){
		alert("Digite sua senha atual!");
		theForm.senha.focus();
		return false;	}
	if(theForm.nv.value==""){
		alert("Digite sua nova senha!");
		theForm.nv.focus();
		return false;	}
	if(theForm.cf.value==""){
		alert("Confirme sua nova senha!");
		theForm.cf.focus();
		return false;	}
	if(theForm.nv.value!=theForm.cf.value){
		alert("Verifique sua nova senha pois ela não confere!");
		theForm.nv.value="";
		theForm.cf.value="";
		theForm.nv.focus();
		return false;	}}

function SEARCH(theForm){
	if(theForm.titulo.value=="" && theForm.autor.value=="" && theForm.editora.value=="" && theForm.isbn.value==""){
		alert("Insira o titulo que deseja pesquisar!");
		theForm.titulo.focus();
		return false;	}
}

function mascara(src, mask){
var i = src.value.length;
var saida = mask.substring(0,1);
var texto = mask.substring(i)
if (texto.substring(0,1) != saida)
{
src.value += texto.substring(0,1);
}
} 

function SoNumero(evtKeyPress) {
	var nTecla;
	nTecla = (evtKeyPress.which) ? evtKeyPress.which : evtKeyPress.keyCode;

	if(!(nTecla > 47 && nTecla < 58) && nTecla !=09 && nTecla !=08)
		return false;
	}

function VIEW(n,tp){
  var total_perguntas = tp;
  for(x=1;x<=total_perguntas;x++){
    document.getElementById(x).style.display='none';
  }
   document.getElementById(n).style.display='';
}
function CLOSEPAY(n){
	document.getElementById(n).style.display='none';
}

