	<!--
//function soNumero(intMax)
function soNumero(objEvento)
{
	if (objEvento == null) objEvento = window.event;
	
	var keyCode = objEvento.keyCode;
	if (!(keyCode > 47 && keyCode < 58))
		event.keyCode = 0;
}

function autoTab(input,len, e)
{
	var intIndexIn = getIndex(input);

	var isNN    = (navigator.appName.indexOf("Netscape") != -1);
	var keyCode = (isNN) ? e.which : e.keyCode; 
	var filter  = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
	var x;
	
	if (len == null) len = input.maxLength;

	if((input.value.length >= len) && (!containsElement(filter,keyCode)))
	{
		input.value = input.value.slice(0, len);
		objAlvo = input.form[(intIndexIn+1) % input.form.length];
		
		if((objAlvo.disabled) == false && objAlvo.style.display == '')
			objAlvo.focus();
		else
		{	objAlvo = input.form[(intIndexIn+2) % input.form.length];
			if((objAlvo.disabled) == false && objAlvo.style.display == '')
				objAlvo.focus();
			else
				input.form[(intIndexIn+4) % input.form.length].focus();
		}
	}
	
	function containsElement(arr, ele)
	{
		var found = false, index = 0;
		while(!found && index < arr.length)
			if(arr[index] == ele)
				found = true;
			else
		index++;
	return found;
	}

	function getIndex(input)
	{
		var index = -1, i = 0, found = false;
		while ((i < input.form.length) && (index == -1))
		if (input.form[i] == input)
			index = i;
		else
			i++;
	
		return index;
	}
	return true;
}
	
function soNumeroFloat(fltMax)
{

}


//Ajusta o Telefone quando esta sendo digitado
function AjustarTelefone(tel,campo) {
var mytel = '';
	mytel = mytel + tel;
    if (mytel.length == 2 ){
        campo.value = "(" + campo.value + ")";
    }
    if (mytel.length == 8){
        campo.value = campo.value + "-";
    }
}


//Ajusta o Cep quando esta sendo digitado
function AjustarCep(Objeto)
{
	if ((event.keyCode<48)||(event.keyCode>57))
	{
		event.returnValue =false;
	} 
	else 
	{ 
		if(Objeto.value.length==2)
		{
			Objeto.value=Objeto.value + "." ;
		}
		else 
		{
    	if(Objeto.value.length==6)
				{		
					Objeto.value=Objeto.value + "-";
				}
		}
	}
}

function AjustarNumero2(Objeto)
{
	if ((event.keyCode==47)||(event.keyCode<46)||(event.keyCode>57))
	{
		event.returnValue =false;
	} 
}

function AjustarNumero(Objeto)
{
	if ((event.keyCode<48)||(event.keyCode>57))
	{
		event.returnValue =false;
	} 
}


//Ajusta o Monetario quando esta sendo digitado
function AjustarMoeda(Objeto)
{
	if ((event.keyCode<48)||(event.keyCode>57))
	{
		event.returnValue =false;
	} 
	else 
	{ 
		if(Objeto.value.length==3)
		{
			Objeto.value="R$ " + Objeto.value + "." ;		
		}
		else
		{
    	if((Objeto.value.length==7)||(Objeto.value.length==10))
				{		
					Objeto.value=Objeto.value + ".";
				}
		}
	}
}

//Ajusta a hora quando esta sendo digitada
function AjustarHora(hora,campo) 
{
var myhora = ''; 
     myhora = myhora + hora; 
     if (myhora.length == 2){ 
         myhora = myhora + ':'; 
         campo.value = myhora; 
      } 
      if (myhora.length == 5){ 
          valor_campo = campo;
		  verifica_hora(valor_campo); 
      } 
} 
  function verifica_hora(valor_campo){ 
  hrs = (valor_campo.value.substring(0,2)); 
  min = (valor_campo.value.substring(3,5)); 
  situacao = ""; 
  // verifica hora 
  if ((hrs < 00 ) || (hrs > 24) || ( min < 00) ||( min > 59)){ 
      situacao = "falsa"; 
  } 
  if (valor_campo.value == "") { 
      situacao = "falsa"; 
  } 
  if (situacao == "falsa") { 
      alert("Hora inválida!");
	  valor_campo.value = "";
      valor_campo.focus(); 
  } 
}

//Ajusta a data quando esta sendo digitada
function AjustarData(data,campo)  
{
              var mydata = ''; 
              mydata = mydata + data; 
              if (mydata.length == 2){ 
                  mydata = mydata + '/'; 
                  campo.value = mydata; 
              } 
              if (mydata.length == 5){ 
                  mydata = mydata + '/'; 
                  campo.value = mydata; 
              } 
              if (mydata.length == 8){
			      valor_campo = campo;
                  verifica_data(valor_campo); 
              } 
} 
            function verifica_data (valor_campo) { 

            dia = (valor_campo.value.substring(0,2)); 
            mes = (valor_campo.value.substring(3,5)); 
            ano = (valor_campo.value.substring(6,10)); 

            situacao = ""; 
            // verifica o dia valido para cada mes 
            if ((dia < 01)||(dia < 01 || dia > 30) && (  mes == 04 || mes == 06 || mes == 09 || mes == 11 ) || dia > 31) { 
                situacao = "falsa"; 
            } 

            // verifica se o mes e valido 
            if (mes < 01 || mes > 12 ) { 
                situacao = "falsa"; 
            } 

            // verifica se e ano bissexto 
            if (mes == 2 && ( dia < 01 || dia > 29 || ( dia > 28 && (parseInt(ano / 4) != ano / 4)))) { 
                situacao = "falsa"; 
            } 
    
            if (valor_campo.value == "") { 
                situacao = "falsa"; 
            } 
    
            if (situacao == "falsa") { 
                alert("Data inválida!"); 
				valor_campo.value = "";
                valor_campo.focus(); 
            } 
            } 

var toolbar=0; 
var menubar=0; 
var statusbar=0;
var scrollbar=1; 
var resizable=0;

function AbrePaginaLocadora(name, url)
{
toolbar_str = toolbar ? 'yes' : 'yes';
menubar_str = menubar ? 'yes' : 'yes';
statusbar_str = statusbar ? 'yes' : 'yes';
scrollbar_str = scrollbar ? 'yes' : 'yes';
resizable_str = resizable ? 'yes' : 'yes';
// Manter o comando abaixo na mesma linha
window.open(url, name, 'left=0,top=0,width=788,height=440,toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

function ResolucaoHorizontal()
{
	if (screen.width <= 800) 
	{
		return (800 - 21) 
	}
	else 
	{
		return (screen.width - 21) 
	}
}

function ResolucaoVertical()
{
	return (screen.height)
}

function ativo(src) 
{
  if (!src.contains(event.fromElement))
  {
    src.bgColor = '#FFFFFF';
    src.style.cursor = 'hand';
	self.status = 'Idi Design - Desenvolvimento de Softwares';
  }
}

function inativo(src) 
{
  if (!src.contains(event.toElement))
  {
    src.bgColor = '#E8E8E8';
    src.style.cursor = 'default';
	self.status = 'Idi Design - Desenvolvimento de Softwares';
  }
}

function clique(src) 
{
  if(event.srcElement.tagName=='TD')
  {
    src.children.tags('A')[0].click();
	self.status = 'Idi Design - Desenvolvimento de Softwares';
  }
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function AbrePagina(Pagina,Frame)
{
  msgWindow = window.open(Pagina,Frame,"");
}

function goBack() { 
  window
	  .back(); 
} 

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 FlagJS()
{
	Hr = new Date() 
	dd = Hr.getDate() 
	mm = Hr.getMonth() + 1 
	aa = Hr.getYear() 	
	hh = Hr.getHours() 
	min = Hr.getMinutes() 
	seg = Hr.getSeconds() 
	Flag = ((dd < 10) ? "0" + dd + "" : dd + "") 
	Flag += ((mm < 10) ? "0" + mm + "" + aa : mm + "" + aa)
	Flag += ((hh < 10) ? "0" + hh + "" : hh + "") 
	Flag += ((min < 10) ? "0" + min + "" : min + "") 
	Flag += ((seg < 10) ? "0" + seg : seg) 
	return Flag
}


//Auto tabulação do formulario
VerifiqueTAB=true;

function checkTAB(){
	VerifiqueTAB= true;
}

function pulaCampo(campo,f){
	//document.form1.loja.tagName 
	if ((campo.tagName=="INPUT" || campo.tagName=="SELECT") && VerifiqueTAB==true){
		if (campo.maxLength==campo.value.length){
			next = 0;
			while (next<f.length && campo.name!=f[next].name) next++;
			next++
			while (next<f.length && f[next].type!="text" && f[next].type!="password" && f[next].type!="checkbox" && f[next].type!="radio" && f[next].nodeName!="SELECT") next++;
			if (next<f.length) f[next].focus();
	
		}
		VerifiqueTAB= false;
	}
}

//Formatação de numeros
//DE		1200.00 
//Para	R$ 1.200,00
function formatCurrency(number){
  var num = new String (number);
  if (num.indexOf (".") == -1){
		intLen = num.length;
    toEnd = intLen;
    var strLeft = new String (num.substring (0, toEnd));
    var strRight = new String ("00");
  }else {
		pos = eval (num.indexOf ("."));
		var strLeft = new String (num.substring (0, pos));
		intToEnd = num.length;
		intThing = pos + 1;
		var strRight = new String (num.substring (intThing, intToEnd));
		if (strRight.length > 2){
			nextInt = strRight.charAt(2);
			if (nextInt >= 5){
				strRight = new String (strRight.substring (0, 2));
				strRight = new String (eval ((strRight * 1) + 1));
				if((strRight * 1) >= 100){
					strRight = "00";
					strLeft = new String (eval ((strLeft * 1) + 1));
				}
				if (strRight.length <= 1){
					strRight = new String ("0" + strRight);
				}
			}else{
				strRight = new String (strRight.substring (0, 2));
			}
		}else{
			if (strRight.length != 2){
				strRight = strRight + "0";
			}
		}
	}
	if (strLeft.length > 3){
		var curPos = (strLeft.length - 3);
		while (curPos > 0){
			var remainingLeft = new String (strLeft.substring (0, curPos));
			var strLeftLeft = new String (strLeft.substring (0, curPos));
			var strLeftRight = new String (strLeft.substring (curPos, strLeft.length));
			strLeft = new String (strLeftLeft + "." + strLeftRight);
			curPos = (remainingLeft.length - 3);
		}
	}
	strWhole = strLeft + "," + strRight;
	finalValue = 'R$ '+ strWhole;
	return (finalValue);
}

//DE		R$ 1.200,00 ou 1.200,00 
//Para	1200.00
function formatEnglish(number){
	number = number + "";
	number = number.replace(/\./g,"");
	number = number.replace(/,/g,".");
	number = number.replace(/ /g,"");
	number = number.replace(/R\$/gi,"");
	return (number);
}


//Auto formatacao para Numero enquanto digita
function verificaValor(campo,e){

  //problema com o tab
  if (campo.value.length == 0)
  {
      campo.value = "R$ ";
      return false;
  }    
  
  //se nao tem virgula
  if ((e==8 && (campo.value=="R$" || campo.value=="R$ ")) ||
		 (e==9 || e==16) ||
		 (campo.value == "R$" || campo.value == "R$ ") ||
		 (campo.value.substring(1,campo.value.length).indexOf("R")>0)){
    campo.value="R$ ";
    return false;
  }
  
  if(campo.value.substring(0,3)=="R$ ")
		valor = campo.value.substring(3,campo.value.length);
  else if(campo.value.substring(0,3)!="R$ "){
		valor = campo.value;
		campo.value = "R$ "+campo.value;
  }

  valorU = valor.substring(valor.length-1);

  if(valorU!="1" && valorU!="2" && valorU!="3" && valorU!="4" &&
valorU!="5" && valorU!="6"
  && valorU!="7" && valorU!="8" && valorU!="9" && valorU!="0" &&
valorU!="." && valorU!=","){

    campo.value=campo.value.substring(0,campo.value.length-1);
    return false;
   }




  if(valor.indexOf(",")<0){

     if(valor.indexOf(".")>0 && valor.length==4){
        part = valor.split(".");
        camp="";
        for(m=0;m<part.length;m++)
          camp+=part[m];
      campo.value ="R$ "+ camp;
       }
     tmp = "";
     for(i=valor.length;i>=0;i--){
       if(valor.charAt(i)!=".")
      tmp += valor.charAt(i);
     }


     tmp2="";
     final ="";
     partes = new Array(parseInt(tmp.length/3)+2);
     for (j=0;j<parseInt((tmp.length-1)/3);j++){
       partes[j] = tmp.substring(3*j,3*j+3);
       final = tmp.substring(3*j+3);

     }



     for(k=0;k < j;k++){
       tmp2 += partes[k]+ ".";
     }

     tmp2+=  (final);
     tmp3="";
     for(i=tmp2.length;i>=0;i--){
      tmp3 += tmp2.charAt(i);
     }


     if( parseInt(tmp2.indexOf("."))==3){
        campo.value ="R$ "+ tmp3;
       }
  }
  //se tem virgula
  else{
    tmp = campo.value.substring(campo.value.lastIndexOf(",")+1,campo.value.length);
    if(tmp.indexOf(".")>0 || tmp.indexOf(",")>0){
      campo.value = campo.value.substring(0, campo.value.length-1);
    }
    if(tmp.length==3)
      campo.value = campo.value.substring(0, campo.value.length-1);
  }
}

function limpa(campo){
  if(campo.value == "R$" || campo.value=="R$ ")
    campo.value="";
  else if(campo.value.length>3 && campo.value.indexOf(",")<0)
    campo.value+=",00";
  else if(campo.value.indexOf(",")>0 && campo.value.substring(campo.value.indexOf(",")).length==2 )
    campo.value+="0";  
}

function justNumber(campo){
	
	buffer = campo.value
	lastChar = buffer.substring(buffer.length - 1)
		

	if(lastChar != "1" && lastChar != "2" && lastChar != "3" && lastChar != "4" &&
	   lastChar != "5" && lastChar != "6" && lastChar != "7" && lastChar != "8" &&
	   lastChar != "9" && lastChar != "0" && lastChar != ".") {

			campo.value = campo.value.substring(0, campo.value.length - 1)    
   }
}

// verifica email quando digitado
//chamada: onchange="return checkbae(this);"
var testresults 
function checkemail(Objeto){ 
var str=Objeto.value 
var filter=/^[\w-]+(\.[\w-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/
if (filter.test(str)) 
testresults=true; 
else{ 
alert("Por favor coloque um endereço de email válido!");
Objeto.value = "";
testresults=false; 
} 
return (testresults); 
} 
function checkbae(Objeto){ 
if (document.layers||document.all) 
return checkemail(Objeto); 
else 
return true; 
}

// Apenas Numero
 function NumerOnly(Objeto) {
            if (( event.keyCode < 48 || event.keyCode > 57 )) {
                  event.returnValue = false;
            }
         }
		 // Apenas número e - . /
		 function NumerOnly1(Objeto) {
            if (( event.keyCode < 48 || event.keyCode > 57 ) && (event.keyCode != 45) && (event.keyCode != 46) && (event.keyCode != 47)) {
                  event.returnValue = false;
            }
         } 
 
 // trava caracter 
function NumerOnlyII(Objeto) {
            if ( event.keyCode != 182) {
                 event.returnValue = false;
            }
} 

// cor do campo
function val(campo,cor) {
if (campo.focus)
{
campo.style.background = cor;
campo.style.color = 'gray';
}
}

// ajustar no formato moeda
function MascaraMoeda(objTextBox, SeparadorMilesimo, SeparadorDecimal, e){
    var sep = 0;
    var key = '';
    var i = j = 0;
    var len = len2 = 0;
    var strCheck = '0123456789';
    var aux = aux2 = '';
    var whichCode = (window.Event) ? e.which : e.keyCode;
    key = String.fromCharCode(whichCode); // Valor para o código da Chave
    if (strCheck.indexOf(key) == -1) return false; // Chave inválida
    len = objTextBox.value.length;
    for(i = 0; i < len; i++)
        if ((objTextBox.value.charAt(i) != '0') && (objTextBox.value.charAt(i) != SeparadorDecimal)) break;
    aux = '';
    for(; i < len; i++)
        if (strCheck.indexOf(objTextBox.value.charAt(i))!=-1) aux += objTextBox.value.charAt(i);
    aux += key;
    len = aux.length;
    if (len == 0) objTextBox.value = '';
    if (len == 1) objTextBox.value =  '0' + SeparadorDecimal + '0' + aux;
    if (len == 2) objTextBox.value =  '0' + SeparadorDecimal + aux;
    if (len > 2) {
        aux2 = '';
        for (j = 0, i = len - 3; i >= 0; i--) {
            if (j == 3) {
                aux2 += SeparadorMilesimo;
                j = 0;
            }
            aux2 += aux.charAt(i);
            j++;
        }
        objTextBox.value = '';
        len2 = aux2.length;
        for (i = len2 - 1; i >= 0; i--)
        objTextBox.value += aux2.charAt(i);
        objTextBox.value += SeparadorDecimal +  aux.substr(len - 2, len)  ;
    }
    return false;
}
             //Ajusta o cpf quando digita
			 function AjustarCpf(cpf,campo){ 
              var mycpf = ''; 
              mycpf = mycpf + cpf; 
              if (mycpf.length == 3){ 
                  mycpf = mycpf + '.'; 
                  campo.value = mycpf; 
              } 
              if (mycpf.length == 7){ 
                  mycpf = mycpf + '.'; 
                  campo.value = mycpf; 
              } 
			  if (mycpf.length == 11){ 
                  mycpf = mycpf + '-'; 
                  campo.value = mycpf; 
              } 
		    }
//-->
