function creditos(){var LARGURA_TOTAL = (screen.availWidth - 500) / 2;var ALTURA_TOTAL = (screen.availHeight - 250) / 2; window.open("http://www.mdmstudio.com.br/creditos/index.php?BOX_QUAL_SITE=Copyright 2005 - 2007 - Platinum Cargas Aéreas&BOX_DIREITOS_SITE=Desenvolvimento do website, suporte e hospedagem<br>O conteúdo cadastrado neste website é de uso exclusivo da empresa<br>A cópia total ou parcial são proibidas&BOX_COD_SITE=33","","toolbar=no,statusbar=no,resizable=no,location=no,menubar=no,scrollbars=no,width=500,height=250,left="+LARGURA_TOTAL+",top="+ALTURA_TOTAL+"")}
function executarSwf_transparent(filme,alt,lar){document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + lar + '" height="' + alt + '">\n');document.write('<param name="movie" value="' + filme + '.swf" />\n');document.write('<param name="quality" value="high" />\n');document.write('<param name="menu" value="false" />\n');document.write('<param name="wmode" value="transparent" />\n');document.write('<embed src="' + filme + '.swf" width="' + lar + '" height="' + alt + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash">\n');document.write('</embed>\n');document.write('</object>\n');}
function executarSwf_white(filme, alt, lar){document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + lar + '" height="' + alt + '">\n');document.write('<param name="movie" value="' + filme + '.swf" />\n');document.write('<param name="quality" value="high" />\n');document.write('<param name="menu" value="false" />\n');document.write('<embed src="' + filme + '.swf" width="' + lar + '" height="' + alt + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash">\n');document.write('</embed>\n');document.write('</object>\n');}
function cd (END, LAR, ALT, ROLAR){var LARGURA_TOTAL = (screen.availWidth - LAR) / 2;var ALTURA_TOTAL = (screen.availHeight - ALT) / 2; ABRIR = window.open(""+END+"","","toolbar=no,statusbar=no,resizable=no,location=no,menubar=no,scrollbars="+ROLAR+",width="+LAR+",height="+ALT+",left="+LARGURA_TOTAL+",top="+ALTURA_TOTAL+""); if (parseInt(navigator.appVersion) >= 4) {ABRIR.window.focus();}}
function tabelas (END){var LARGURA_TOTAL = (screen.availWidth - 500) / 2;var ALTURA_TOTAL = (screen.availHeight - 500) / 2; ABRIR = window.open(""+END+"","","toolbar=no,statusbar=no,resizable=no,location=no,menubar=no,scrollbars=no,width=500,height=500,left="+LARGURA_TOTAL+",top="+ALTURA_TOTAL+""); if (parseInt(navigator.appVersion) >= 4) {ABRIR.window.focus();}}
function AbrePagina(Foto, tamx, tamy){var LARGURA_TOTAL = (screen.availWidth - tamx) / 2;var ALTURA_TOTAL = (screen.availHeight - tamy) / 2; window.open(Foto,"","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=no,left="+LARGURA_TOTAL+",top="+ALTURA_TOTAL+",width=" + tamx + ",height=" + tamy)}
function mask(){us = document.rastreamento.b_user.value; ps = document.rastreamento.b_pass.value; window.open('http://www.logfacil.com.br/sislognet/Default.aspx?id=262&WhereWasI=http%3a@@www.platinumlog.com.br@&lu='+ us + '&lp=' + ps);}

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; 
      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( " ", "" );
	  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 acao(END, LAR, ALT, ROLAR){
var LARGURA_TOTAL = (screen.availWidth - LAR) / 2;
var ALTURA_TOTAL = (screen.availHeight - ALT) / 2;

ABRIR = window.open(""+END+"","","toolbar=no,statusbar=no,resizable=no,location=no,menubar=no,scrollbars="+ROLAR+",width="+LAR+",height="+ALT+",left="+LARGURA_TOTAL+",top="+ALTURA_TOTAL+"");

if (parseInt(navigator.appVersion) >= 4) {
ABRIR.window.focus();
}}


function esconderMostrar(ELEMENTO, ACAO){
document.getElementById(ELEMENTO).style.display = ACAO;
}

function aparece(ID){
var LAR = screen.availWidth - 40;
var ALT = screen.availHeight - 160;
document.getElementById(""+ID+"").style.height = ALT + 'px'; document.getElementById(""+ID+"").style.width = LAR + 'px';
document.getElementById(""+ID+"").style.display = 'block';
 
} 
function aparecePopups(ID, LAR, ALT){
document.getElementById(""+ID+"").style.height = ALT + 'px'; document.getElementById(""+ID+"").style.width = LAR + 'px';
document.getElementById(""+ID+"").style.display = 'block';
} 
function desaparece(ID){
document.getElementById(""+ID+"").style.display = 'none';
}

function abre(qual){
	
	for(i=1;i<=3;i++){
	
		if(document.getElementById('sub_'+i).style.display=="block"){
		
			document.getElementById('sub_'+i).style.display="none";
		
		}
		
	}
	
	document.getElementById('sub_'+qual).style.display="block";
	
}

function login_webmail(){
	
	var formulario = document.webmail;
	
	if(formulario.user.value==""){
		
		alert('Por favor preencha o nome de usuário.\nNão é necessário digitar @platinumlog.com.br');
		formulario.user.focus();
		return false;
	}
	
	if(formulario.pass.value==""){
	
		alert('Por favor preencha a sua senha de acesso.');
		formulario.pass.focus();
		return false;
	
	} else {
	
	var arroba  = formulario.user.value.split("@");
	var usuario = arroba[0] + "@platinumlog.com.br";
	
	formulario.user.value = usuario;
	
	alert(formulario.user.value);
	
	return true;
	
	}}
