
function openWin( windowURL, windowName, windowFeatures ) { 
		return window.open( windowURL, windowName, windowFeatures ) ; 
}
function voltaUm(){
	history.back;	
}

/*
--------------------------------------------------------------------------------
 Função:		Tecla
 Objetivo:		A função tecla tem como finalidade bloquear a digitação de 
 				caracteres inválidas no campo informado pelo tipo de campo.
 Sintaxe:		onKeyPress="Tecla(this, 'numero')"
 				onKeyPress="Tecla(this, 'texto')"
--------------------------------------------------------------------------------
*/

// Função que bloqueia a digitação de caracteres inválidos 
function Tecla(Valor, TipoCampo) {
	
	// Internet Explorer
	if (document.all) var tecla = event.keyCode;
	
	// Netscape
	else if(document.layers) var tecla = Valor.which;
	
	// Campos Numérios não negativos
	if (TipoCampo == "numero") {
		// Teclas de 0 a 9
		if (tecla > 47 && tecla < 58) return true;
		else {
		
			// Backspace
			if (tecla != 8) event.keyCode = 0;
			else return true;
		}		
	}
	
	// Campos Texto
	if (TipoCampo == "texto") {		
		if ((tecla != 34) && (tecla != 39)) return true;
		else return false;		
	}	
}

/*
--------------------------------------------------------------------------------
 Função:		MascaraData
 Objetivo:		Esta função tem como objetivo aplicar ao campo informado a 
 				máscara de data, no formato ??/??/????
 Sintaxe:		onKeyPress="MascaraData(this)" maxlength="10"
--------------------------------------------------------------------------------
*/
function MascaraData(Campo) {
	if (Campo.value.length == 2) Campo.value += "/";
	if (Campo.value.length == 5) Campo.value += "/";
}


function MascaraCPF(Campo) {
	if (Campo.value.length == 3) Campo.value += ".";
	if (Campo.value.length == 7) Campo.value += ".";
	if (Campo.value.length == 11) Campo.value += "-";
}


function MascaraCNPJ(Campo) {
	if (Campo.value.length == 2) Campo.value += ".";
	if (Campo.value.length == 6) Campo.value += ".";
	if (Campo.value.length == 10) Campo.value += "/";
	if (Campo.value.length == 15) Campo.value += "-";
}

function MascaraFone(Campo) {
	if (Campo.value.length == 4) Campo.value += "-";
}

function MascaraCEP(Campo) {
	if (Campo.value.length == 2) Campo.value += ".";
	if (Campo.value.length == 6) Campo.value += "-";
}

function mostraPag() {

	if (document.PagSeguro.aceite.checked==true){
			if (document.PagSeguro.formaPagamento.value=="faturamento"){
			window.location="retorno.asp?acao=fat"
			return false;
			}
			else {
				document.PagSeguro.submit()
			}
		
				
	}
	if (document.PagSeguro.aceite.checked==false){
	alert("Você precisa concordar com os termos para que a venda possa ser finalizada");		
	}
}



// JavaScript Document