<!--####################################### STATUS BAR #################################################################################-->


window.defaultStatus="::: SOPREVI | Saúde Bucal"


<!--####################################### FUNCOES PARA TROCAR O ICONE NO MENU DA ESQUERDA ##########################################################################-->


function imgover(imgname){
imgname.src = "../images/img_Marcador_Menu_On.gif"
}
function imgout(imgname){
imgname.src = "../images/img_Marcador_Menu.gif"
}


<!--####################################### FUNÇÃO DE ESCONDER E MOSTRAR LAYERS DO MENU ##########################################################################-->


var menuAtual;
var icoAtual;
var icoAnterior="";
function mostraEsconde(menu,imagem){
	menuAtual = menu;
	icoAtual = imagem;
	
	//layers 
	MM_showHideLayers('lyrUm','','show','lyrDois','','show','lyrTres','','show')
	MM_showHideLayers('lyrSoprevi','','hide')
	MM_showHideLayers('lyrServicos','','hide')
	MM_showHideLayers('lyrAtendimento','','hide')

		if(icoAnterior != "" ){
		MM_findObj(icoAnterior).src = '../images/img_Marcador_Menu.gif'
		}

	// menu e icones que ligam
	MM_findObj(imagem).src = '../images/img_Marcador_Menu_On.gif'	
		if (menu!="nada"){
		MM_showHideLayers(menu,'','show')
		}
	
	icoAnterior = icoAtual;
}

function layersEscondem(){
	MM_showHideLayers('lyrUm','','hide','lyrDois','','hide','lyrTres','','hide')
		if (menuAtual != "nada"){
		MM_showHideLayers(menuAtual,'','hide')
		}
	MM_findObj(icoAtual).src = '../images/img_Marcador_Menu.gif'
	
}


<!--####################################### OPEN BRWINDOW ##########################################################################-->


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


<!--####################################### LAYERS ##########################################################################-->


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() { //v3.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; }
}

<!--####################################### FORMATA  ##########################################################################-->

/**** Descrição.: formata um campo do formulário de* acordo com a máscara informada...
* Parâmetros: - objForm (o Objeto Form)
* - strField (string contendo o nome do textbox) - alterado, campo não existe mais
* - sMask (mascara que define o formato que o dado será apresentado, 
* usando o algarismo "9" para definir números e o símbolo "!" para qualquer caracter...
* - evtKeyPress (evento)
* Uso.......: <input type="textbox" name="xxx".....
* onkeypress="return txtBoxFormat(document.rcfDownload, 'str_cep', '99999-999', event);">
* Observação: As máscaras podem ser representadas como os exemplos abaixo:
* CEP -> 99.999-999
* CPF -> 999.999.999-99
* CNPJ -> 99.999.999/9999-99
* Data -> 99/99/9999
* Tel Resid -> (99) 999-9999
* Tel Cel -> (99) 9999-9999
* Processo -> 99.999999999/999-99
* C/C -> 999999-!
* E por aí vai...
***/
function txtBoxFormat(sMask, evtKeyPress) {     
    var i, nCount, sValue, fldLen, mskLen,bolMask, sCod, nTecla;     

    if(window.event) { // Internet Explorer       
        nTecla = evtKeyPress.keyCode; 
    } else if(evtKeyPress.which) { 
        // Nestcape / firefox       
        nTecla = evtKeyPress.which;     
    }    

    //se for backspace não faz nada    
    if (nTecla != 8 && nTecla != 37 && nTecla != 39){     
        sValue = evtKeyPress.srcElement.value;
//        sValue = document.getElementById(strField).value;

        // Limpa todos os caracteres de formatação 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++;     
        }     

//        document.getElementById(strField).value = sCod;
        evtKeyPress.srcElement.value = sCod;     

        if (nTecla != 8 && nTecla != 37 && nTecla != 39){     
            // 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;     
        }    
    }//fim do if que verifica se é backspace
}//Fim da Função Máscaras Gerais

//-->
