<!-- Begin
function NewWindow(mypage, myname, w, h, scroll) {
var wint = (screen.height - h) / 2;
var winl = (screen.width - w) / 20;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+''
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

// ************************************************************************************************************************


/* Validação Falecom */
	
	function OcultaAlert(){
		document.getElementById('PopAlert').style.display = 'none';
		document.getElementById(campo).select();
	}
	function VerificaContato(){
		if (document.form1.nome.value == ""){
			document.getElementById('PopText').innerHTML =  'Por favor, informe seu nome';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'nome';
			return false;
		}
		if (document.form1.email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.info)|(\.br)|(\..{2,2}))$)\b/gi)){			
		}
		else {
			document.getElementById('PopText').innerHTML = 'Por favor, informe um email valido';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'email';
	   		return false;
		}
		if (document.form1.mensagem.value == ""){
			document.getElementById('PopText').innerHTML = 'Digite sua mensagem';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'mensagem';
			return false;
		}
	return true; 
	}
	function EnviaContato(){
		if (VerificaContato())
			document.form1.submit();
	}
	function ExibeOcultaSelect(obj){
		if(document.getElementById){
		var el = document.getElementById(obj);
		var ar = document.getElementById(obj);
			if(el.style.display != "block"){
				for (var i=0; i<ar.length; i++){
					if (ar[i].className==(obj))
					ar[i].style.display = "none";
				}
				el.style.display = "block";
			}
			else{
				el.style.display = "none";
			}
		}
	}
// ************************************************************************************************************************

/* Validação Contratar */

function EmptyField(id){
var Fid = document.getElementById(id);
var TheDefaultValue = Fid.defaultValue;
var TheValue = Fid.value;
if(TheDefaultValue == TheValue){
Fid.value = '';
}
}
	
	function OcultaAlert(){
		document.getElementById('PopAlert').style.display = 'none';
		document.getElementById(campo).select();
	}
	function VerificaContrato(){
		if(document.form1.pj[0].checked == false && document.form1.pj[1].checked == false){
			document.getElementById('PopText').innerHTML =  'Por favor, selecione o tipo de CONTRATANTE';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'pj';
			return false;
		}
		if (document.form1.resp.value.length<5){
			document.getElementById('PopText').innerHTML =  'Por favor, informe o Nome Completo do Responsável';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'resp';
			return false;
		}
		if (document.form1.pj[0].checked == true){
		if (document.form1.rs.value == "" ){
			document.getElementById('PopText').innerHTML =  'Por favor, informe a Razão Social da empresa';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'rs';
			return false;
		}
		
		if (document.form1.cnpj.value == "" ){
			document.getElementById('PopText').innerHTML =  'Por favor, informe o CNPJ da empresa';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'cnpj';
			return false;
		}		
		} else if(document.form1.pj[1].checked == true){
		if (document.form1.cpf.value == "" ){
			document.getElementById('PopText').innerHTML =  'Por favor, informe o CPF do Responsável';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'cpf';
			return false;
		}
		
		if (document.form1.rg.value == "" ){
			document.getElementById('PopText').innerHTML =  'Por favor, informe o RG do Responsável';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'rg';
			return false;
		}		
		} 
		if (document.form1.end.value == ""){
			document.getElementById('PopText').innerHTML =  'Por favor, informe o Endereço';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'end';
			return false;
		}		
        if (document.form1.num.value == ""){
			document.getElementById('PopText').innerHTML =  'Por favor, informe o Número solicitado';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'num';
			return false;
		}
        if (document.form1.bairro.value == ""){
			document.getElementById('PopText').innerHTML =  'Por favor, informe o Bairro';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'bairro';
			return false;
		}
		if (document.form1.cid.value.length<3){
			document.getElementById('PopText').innerHTML =  'Por favor, informe a Cidade sem abreviação';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'cid';
			return false;
		}
        if (document.form1.uf.value == "selecione"){
			document.getElementById('PopText').innerHTML =  'Por favor, selecione o Estado';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'uf';
			return false;
		}       
        if (document.form1.cep.value == ""){
			document.getElementById('PopText').innerHTML =  'Por favor, informe o CEP';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'cep';
			return false;
		}
        if (document.form1.ddd.value == ""){
			document.getElementById('PopText').innerHTML =  'Por favor, informe o DDD';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'ddd';
			return false;
		}
        if (document.form1.tel.value == ""){
			document.getElementById('PopText').innerHTML =  'Por favor, informe o Telefone';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'tel';
			return false;
		}
		if (document.form1.email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.gov)|(\.br)|(\..{2,2}))$)\b/gi)){			
			}	else {
			document.getElementById('PopText').innerHTML = 'Por favor, informe um e-Mail válido';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'email';
	   		return false;
		}
		if(document.form1.servico[0].checked == false && document.form1.servico[1].checked == false && document.form1.servico[2].checked == false){
			document.getElementById('PopText').innerHTML =  'Por favor, selecione qual de nossos serviços deseja contratar';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'servico';
			return false;
		}
		if (document.form1.servico[0].checked == true){
			if (document.form1.regdom.value == "" || document.form1.regdom.value.length>23){
			document.getElementById('PopText').innerHTML =  'Por favor, informe o Domínio, com até 23 caracteres';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'regdom';
			return false;
			}
		}
		if (document.form1.servico[1].checked == true){
			if (document.form1.domloja.value == "coloque aqui o nome da loja" || document.form1.domloja.value == "" || document.form1.domloja.value.length>20){
			document.getElementById('PopText').innerHTML =  'Por favor, informe o Nome da Loja no campo Subdomínio, com até 20 caracteres';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'domloja';
			return false;
			}
		}
		if (document.form1.servico[2].checked == true){
			if (document.form1.domweb.value == "" || document.form1.domweb.value.length>23){
			document.getElementById('PopText').innerHTML =  'Por favor, informe o Domínio, com até 23 caracteres';
			document.getElementById('PopAlert').style.display = 'block';
			campo = 'domweb';
			return false;
			}
		}
		
	return true; 
	}
	
	
	function EnviaContrato(){
		if (VerificaContrato())
			document.form1.submit();
	}
	function ExibeOcultaSelect(obj){
		if(document.getElementById){
		var el = document.getElementById(obj);
		var ar = document.getElementById(obj);
			if(el.style.display != "block"){
				for (var i=0; i<ar.length; i++){
					if (ar[i].className==(obj))
					ar[i].style.display = "none";
				}
				el.style.display = "block";
			}
			else{
				el.style.display = "none";
			}
		}
	}

// ************************************************************************************************************************
<!--
function ver() {
	cpf = document.form1.cpf.value;
//var cpf = campo.value;

               erro = new String;
               if (cpf.length < 14) erro += "Preencha corretamente o número do CPF!\n 999.999.999-99\n\n";

               if(document.layers && parseInt(navigator.appVersion) == 4){
                       x = cpf.substring(0,2);
                       x += cpf. substring (3,6);
                       x += cpf. substring (7,9);
                       x += cpf. substring (10,11);
                       cpf = x;
               } else {
                       cpf = cpf. replace (".","");
                      cpf = cpf. replace (".","");
                       cpf = cpf. replace ("-","");
               }

var POSICAO, I, SOMA, DV, DV_INFORMADO;
var DIGITO = new Array(10);
DV_INFORMADO = cpf.substr(9, 2);

for (I=0; I<=8; I++) {
  DIGITO[I] = cpf.substr( I, 1);
}

POSICAO = 10;
SOMA = 0;
   for (I=0; I<=8; I++) {
      SOMA = SOMA + DIGITO[I] * POSICAO;
      POSICAO = POSICAO - 1;
   }
DIGITO[9] = SOMA % 11;
   if (DIGITO[9] < 2) {
        DIGITO[9] = 0;
}
   else{
       DIGITO[9] = 11 - DIGITO[9];
}

POSICAO = 11;
SOMA = 0;
   for (I=0; I<=9; I++) {
      SOMA = SOMA + DIGITO[I] * POSICAO;
      POSICAO = POSICAO - 1;
   }
DIGITO[10] = SOMA % 11;
   if (DIGITO[10] < 2) {
        DIGITO[10] = 0;
   }
   else {
        DIGITO[10] = 11 - DIGITO[10];
   }

DV = DIGITO[9] * 10 + DIGITO[10];
   if (DV != DV_INFORMADO) {
      alert('O CPF está incorreto\n\n');
      document.form1.cpf.value = '';
      document.form1.cpf.focus();
      return false;
   }
}
//-->

// ************************************************************************************************************************

       function valida() {
                CNPJ = document.form1.cnpj.value;
                erro = new String;
               if (CNPJ.length < 18) erro += "Preencha corretamente o número do CNPJ!\n 99.999.999/9999-99\n\n"; 
              
               if(document.layers && parseInt(navigator.appVersion) == 4){
                       x = CNPJ.substring(0,2);
                       x += CNPJ. substring (3,6);
                       x += CNPJ. substring (7,10);
                       x += CNPJ. substring (11,15);
                       x += CNPJ. substring (16,18);
                       CNPJ = x; 
               } else {
                       CNPJ = CNPJ. replace (".","");
                      CNPJ = CNPJ. replace (".","");
                       CNPJ = CNPJ. replace ("-","");
                       CNPJ = CNPJ. replace ("/","");
               }
              var nonNumbers = /\D/;
               if (nonNumbers.test(CNPJ)) erro += "A verificação de CNPJ suporta apenas números! \n\n"; 
               var a = [];
               var b = new Number;
               var c = [6,5,4,3,2,9,8,7,6,5,4,3,2];
               for (i=0; i<12; i++){
                       a[i] = CNPJ.charAt(i);
                       b += a[i] * c[i+1];
 }
              if ((x = b % 11) < 2) { a[12] = 0 } else { a[12] = 11-x }
              b = 0;
              for (y=0; y<13; y++) {
                       b += (a[y] * c[y]); 
              }
               if ((x = b % 11) < 2) { a[13] = 0; } else { a[13] = 11-x; }
               if ((CNPJ.charAt(12) != a[12]) || (CNPJ.charAt(13) != a[13])){
                       erro +="O CNPJ está incorreto!";
               }
               if (erro.length > 0){
                      alert(erro);
                    document.form1.cnpj.value = '';
      				document.form1.cnpj.focus();
                       return false;
              }
              return true;
       }

// ************************************************************************************************************************

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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->


// ************************************************************************************************************************


function txtBoxFormat(objForm, strField, sMask, evtKeyPress) {
var i, nCount, sValue, fldLen, mskLen,bolMask, sCod, nTecla;
if(document.all) { 
nTecla = evtKeyPress.keyCode; }
else if(document.layers) { 
nTecla = evtKeyPress.which;
}

sValue = objForm[strField].value;
sValue = sValue.toString().replace( "-", "" );
sValue = sValue.toString().replace( "-", "" );
sValue = sValue.toString().replace( ".", "" );
sValue = sValue.toString().replace( ".", "" );
sValue = sValue.toString().replace( "/", "" );
sValue = sValue.toString().replace( "/", "" );
sValue = sValue.toString().replace( "(", "" );
sValue = sValue.toString().replace( "(", "" );
sValue = sValue.toString().replace( ")", "" );
sValue = sValue.toString().replace( ")", "" );
sValue = sValue.toString().replace( " ", "" );
sValue = sValue.toString().replace( " ", "" );
fldLen = sValue.length;
mskLen = sMask.length;

i = 0;
nCount = 0;
sCod = "";
mskLen = fldLen;

while (i <= mskLen) {
bolMask = ((sMask.charAt(i) == "-") || (sMask.charAt(i) == ":") || (sMask.charAt(i) == ".") || (sMask.charAt(i) == "/"))
bolMask = bolMask || ((sMask.charAt(i) == "(") || (sMask.charAt(i) == ")") || (sMask.charAt(i) == " "))

if (bolMask) {
sCod += sMask.charAt(i);
mskLen++; }
else {
sCod += sValue.charAt(nCount);
nCount++;
}
i++;
}

objForm[strField].value = sCod;
if (nTecla != 8) { // backspace
if (sMask.charAt(i-1) == "9") { // apenas números...
return ((nTecla > 47) && (nTecla < 58)); } // números de 0 a 9
else { // qualquer caracter...
return true;
}
} else {
return true;
}
}
// ************************************************************************************************************************

function changetext(bloco) {            
    if(bloco.style.display==''||bloco.style.display=='block') {
         bloco.style.display='none';
    } else {
         bloco.style.display='block';
    }
}