function popup(){
var v1=arguments,v2=v1[2].split(","),v3=(v1.length>3)?v1[3]:false,v4=(v1.length>4)?parseInt(v1[4]):0,v5=(v1.length>5)?parseInt(v1[5]):0,v6,v7=0,v8,v9,v10,v11,v12,v13,v14,v15,v16;v11=new Array("width,left,"+v4,"height,top,"+v5);for (i=0;i<v11.length;i++){v12=v11[i].split(",");l_iTarget=parseInt(v12[2]);if (l_iTarget>1||v1[2].indexOf("%")>-1){v13=eval("screen."+v12[0]);for (v6=0;v6<v2.length;v6++){v10=v2[v6].split("=");if (v10[0]==v12[0]){v14=parseInt(v10[1]);if (v10[1].indexOf("%")>-1){v14=(v14/100)*v13;v2[v6]=v12[0]+"="+v14;}}if (v10[0]==v12[1]){v16=parseInt(v10[1]);v15=v6;}}if (l_iTarget==2){v7=(v13-v14)/2;v15=v2.length;}else if (l_iTarget==3){v7=v13-v14-v16;}v2[v15]=v12[1]+"="+v7;}}v8=v2.join(",");v9=window.open(v1[0],v1[1],v8);if (v3){v9.focus();}document.MM_returnValue=false;return v9;}

function janela(){
var v1=arguments,v2=v1[2].split(","),v3=(v1.length>3)?v1[3]:false,v4=(v1.length>4)?parseInt(v1[4]):0,v5=(v1.length>5)?parseInt(v1[5]):0,v6,v7=0,v8,v9,v10,v11,v12,v13,v14,v15,v16;v11=new Array("width,left,"+v4,"height,top,"+v5);for (i=0;i<v11.length;i++){v12=v11[i].split(",");l_iTarget=parseInt(v12[2]);if (l_iTarget>1||v1[2].indexOf("%")>-1){v13=eval("screen."+v12[0]);for (v6=0;v6<v2.length;v6++){v10=v2[v6].split("=");if (v10[0]==v12[0]){v14=parseInt(v10[1]);if (v10[1].indexOf("%")>-1){v14=(v14/100)*v13;v2[v6]=v12[0]+"="+v14;}}if (v10[0]==v12[1]){v16=parseInt(v10[1]);v15=v6;}}if (l_iTarget==2){v7=(v13-v14)/2;v15=v2.length;}else if (l_iTarget==3){v7=v13-v14-v16;}v2[v15]=v12[1]+"="+v7;}}v8=v2.join(",");v9=window.open(v1[0],v1[1],v8);if (v3){v9.focus();}document.MM_returnValue=false;return v9;}

// Função JumpMenu
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// Função abre Janela pop-up
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
// Janela pop-up
//function Popup(url, tamx, tamy, nome) {
//	window.open(url,"nome","resizable=no,toolbar=no,status=no,menubar=no,copyhistory=no,screenX=150,screenY=120,left=150,top=120,scrollbars=yes,width=" + tamx + ",height=" + tamy)
//}

// Valida formulario contato
function contato(faleconosco) {
	var oform = document.faleconosco;

	if (oform.nome.value == "") {
		alert("Digite o nome");
		oform.nome.focus();
		return (false);
	}
	if (oform.email.value == "") {
		alert("Digite o e-mail");
		oform.email.focus();
		return (false);
	}
	if (oform.assunto.value == "") {
		alert("Digite o assunto");
		oform.assunto.focus();
		return (false);
	}
	if (oform.mensagem.value == "") {
		alert("Digite a mensagem");
		oform.mensagem.focus();
		return (false);
	} else {

		// EMITE UMA MENSAGEM DE CONFIRMAÇÃO
			if (confirm('Confirma o envio?')) {
				oform.submit();
			} else return(false); 
		 }	
}

// Valida formulario Cadastro
function cadastro(Form) {
	var oform = document.form; //Nome do Form

	if (oform.nome.value == "") {
		alert("Digite o nome!");
		oform.nome.focus();
		return (false);
	}
	if (oform.login.value == "") {
		alert("Digite o seu login!");
		oform.login.focus();
		return (false);
	}
	if (oform.senha.value == "") {
		alert("Digite sua senha!");
		oform.senha.focus();
		return (false);
	}
	if (oform.senha.value != oform.senha2.value) {
		alert("Senha não confere!");
		oform.senha2.focus();
		return (false);
	}

	if (oform.email.value == "") {
		alert("Digite o seu e-mail!");
		oform.email.focus();
		return (false);
	}
	if (oform.cpf.value == "") {
		alert("Digite o seu CPF!");
		oform.cpf.focus();
		return (false);
	}
	if (oform.ndeposito.value == "") {
		alert("Digite o o N° do deposito!");
		oform.ndeposito.focus();
		return (false);
	}
	if (oform.planos.value == "") {
		alert("Selecione um plano!");
		oform.planos.focus();
		return (false);
	} else {

		// Confirmação
			if (confirm('Confirma o envio?')) {
				oform.submit();
			} else return(false); 
		 }	
}

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 valida(form){
	if(!form.buscar.value){
		alert("Por favor digite uma palavra para a busca");
		form.buscar.focus();
		return false;
	}
	if(form.buscar.value.length < 3){
		alert("Por favor digite uma palavra para a busca com mais de 3 letras");
		form.buscar.focus();
		return false;
	}
return true;
}
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}
//Formatação
function txtBoxFormat(objForm, strField, sMask, evtKeyPress) {
      var i, nCount, sValue, fldLen, mskLen,bolMask, sCod, nTecla;

      if(document.all) { // Internet Explorer
        nTecla = evtKeyPress.keyCode; }
      else if(document.layers) { // Nestcape
        nTecla = evtKeyPress.which;
      }

      sValue = objForm[strField].value;

      // Limpa todos os caracteres de formataçao que
      // já estiverem no campo.
      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) == "/"))
        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;
      }
    }
