  function alertAR(msg){
           //exibe as msg de alerta personalizadas
           alert(msg+'\n_____________________________________________\narchiVio Tecnologia da Informação Ltda');
  }

  function abre_convite(conv){
           url= "site/aniversarios/imprime.php?conv="+conv;
           window.open(url,'convite','width=500,height=500,menubar=yes,scrollbars=no,toolbar=no,location=no,directories=no,resizable=no,top=5,left=5');
  }

  function limpa_busca(){
           document.formbusca.busca.value= "";
  }

  function CriticaCampos(){
    if (document.Geral.Localidade.value == ""){
        alert("Informe o nome completo da Cidade/Município/Distrito/Povoado. Para o DF poderá ser informado o nome da Região Administrativa (Lago Sul, Cruzeiro, Taguatinga, etc) !!");
        document.Geral.Localidade.focus();
        return (false);
    }else{
         var Branco = " ";
         var Posic, Carac;
         var Temp = document.Geral.Localidade.value.length;
         var Cont = 0;
         for (var i=0; i < Temp; i++){
              Carac =  document.Geral.Localidade.value.charAt (i);
              Posic  = Branco.indexOf (Carac);
              if (Posic == -1)
              Cont++;
         }
         if (Cont <= 0){
             alert("Informe o nome completo da Cidade/Município/Distrito/Povoado. Para o DF poderá ser informado o nome da Região Administrativa (Lago Sul, Lago Norte, Cruzeiro, Taguatinga, etc) !!");
             document.Geral.Localidade.focus();
             return (false);
         }
    }
    if (document.Geral.Logradouro.value == ""){
        alert("Informe o nome do logradouro");
        document.Geral.Logradouro.focus();
        return (false);
    }else{
         var Branco = " ";
         var Posic, Carac;
         var Temp = document.Geral.Logradouro.value.length;
         var Cont = 0;
         for (var i=0; i < Temp; i++){
              Carac =  document.Geral.Logradouro.value.charAt (i);
              Posic  = Branco.indexOf (Carac);
              if (Posic == -1)
              Cont++;
         }
         if (Cont <= 0){
            alert("Informe o nome do logradouro");
            document.Geral.Logradouro.focus();
            return (false);
         }
    }
  }

  function AjudaLogradouro(){
       DocRemote = window.open ('http://www.correios.com.br/servicos/cep/ajuda_cep_loc_log.htm','Logradouro','scrollbars,resizable,width=300,height=400');
  }

  function abre_link_banner(url){

           window.open(url,'janela','width=500,height=500,menubar=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,resizable=yes,top=5,left=5');
  }
 
 function addFavoritos(){  
			 var URLSite = window.location.href;
			 var TituloSite = document.title;
			 if (document.all) window.external.AddFavorite(URLSite,TituloSite);
 }
 
 function pagPrincipal(){
             principal.style.behavior='url(#default#homepage)'; 
             principal.setHomePage('http://www.safepark.com.br');
 }
 
   function FormataCEP(campo, teclapres){
           var tecla = teclapres.keyCode;
           var vr    = new String(campo.value);
           vr        = vr.replace("-", "");
           vr        = vr.replace("-", "");
           tam       = vr.length + 1;
           if (tecla != 9 && tecla != 8){
               if (tam > 5 && tam < 7){
                   campo.value = vr.substr(0, 6) + '-' + vr.substr(6, tam);
               }
           }
  }
	  
  function mostra_oculta(iddiv,total){
           var div= document.getElementById(iddiv);
           var div2=0;

           /*for(i=1;i<=total;i++){
              div2= document.getElementById(i);
              if(div2!=div){
                 div2.style.display = 'none';
              }
           }*/

           if(div){
              if(div.style.display == 'none' || !div.style.display){
                 div.style.display = 'block';
                 
              }else{
                    div.style.display = 'none';
                    
              }
           }

  }
  
  function mostra_oculta_laaat(iddiv,total){
           var div= document.getElementById(iddiv);
           var div2=0;

           /*for(i=1;i<=total;i++){
              div2= document.getElementById(i);
              if(div2!=div){
                 div2.style.display = 'none';
              }
           }*/

           if(div){
              if(div.style.display == 'none' || !div.style.display){
                 div.style.display = 'block';
              }else{
                    div.style.display = 'none';
                    
              }
           }

  }
  
  function mostra_ocultaServicos(iddiv,total){
           var div   = document.getElementById(iddiv);
           //var botao = document.getElementById('botao'+iddiv);
           var div2  = 0;

          /* for(i=1;i<=total;i++){
              div2= document.getElementById(i);
              if(div2!=div){
                 div2.style.display = 'none';
              }
           }*/

           if(div){
              if(div.style.display == 'none' || !div.style.display){
                   //botao.value       = 'Fechar';
                   div.style.display = 'block';
              }else{
                   //	botao.value       = 'Mais informações';
                   div.style.display = 'none';
              }
           }

  }
  
  function subMenuAbre(divName,cell){
  	     divName = document.getElementById(divName);
  	     cell    = document.getElementById(cell);
  	     
  	     divName.style.visibility = 'visible';
  	     cell.style.cursor        = 'pointer';
  }
  
  function subMenuFecha(divName){
  	     divName = document.getElementById(divName);
  	     divName.style.visibility = 'hidden';
  }
  
  function abre_mapa(){
              larg= screen.availWidth;
              alt = screen.availHeight;
              window.open('site/localizacao/imprimemapa.php','janela','resizable=yes,directories=no,hotkeys=no,location=no,menubar=yes,personalbar=no,scrollbars=yes,status=no,toolbar=no,width=600,height=495,screenX=0,screenY=0');
              //jan.moveTo(0,0);
              //jan.resizeTo(larg,alt);

    }
    
    function AbrirMapas(url)
   {
   window.open(url,"imagem", 'width=420,height=430,scrollbars=no,resizable=no');
   }
   
   function mostra_oculta_faq(iddiv){
           var div= document.getElementById(iddiv);
           if(div){
              if(div.style.display == 'none' || !div.style.display){
                 div.style.display = 'block';
              }else{
                    div.style.display = 'none';
              }
           }

  }
  
  function abreNovidades(aba,img_path,displayTexto){
  	    aba1 = document.getElementById('1');
  	    aba2 = document.getElementById('2');
  	    aba3 = document.getElementById('3');
  	    displayTexto = document.getElementById(displayTexto);
  	    
  	    displayTexto.innerHtml = '<center><img src="'+img_path+'/loading.gif" align="absmiddle"><br><font style="color:#999999">[Processando...]</font></center>';
  	    
  	    switch(aba){
  	    	     case 1:
  	    	          aba1.style.backgroundImage = 'URL(\'' + img_path + 'aba_novidades_bg_over.gif\')';
  	    	          aba3.style.backgroundImage = 'URL(\'' + img_path + 'aba_novidades_bg.gif\')';
  	    	          aba2.style.backgroundImage = 'URL(\'' + img_path + 'aba_novidades_bg.gif\')';
  	    	          
  	    	          aba1.style.fontColor = '#FFFFFF';
  	    	          break;
  	    	     case 2:
  	    	          aba1.style.backgroundImage = 'URL(\'' + img_path + 'aba_novidades_bg.gif\')';
  	    	          aba2.style.backgroundImage = 'URL(\'' + img_path + 'aba_novidades_bg_over.gif\')';
  	    	          aba3.style.backgroundImage = 'URL(\'' + img_path + 'aba_novidades_bg.gif\')';
  	    	          break;
  	    	     case 3:
  	    	          aba1.style.backgroundImage = 'URL(\'' + img_path + 'aba_novidades_bg.gif\')';
  	    	          aba2.style.backgroundImage = 'URL(\'' + img_path + 'aba_novidades_bg.gif\')';
  	    	          aba3.style.backgroundImage = 'URL(\'' + img_path + 'aba_novidades_bg_over.gif\')';
  	    	          break;
  	    }
  }

  function Abrir()
  {
  window.open('chat/index.php?arq=bemvindo.php',"atendimento", 'height=485,width=400,scrollbars=yes,resizable=no');
  }
  
  function FlashLibrary(){
    var t = this;
    var activeX = false;
    t.ieAutoInstall = false;
    t.hasVersion = function(ver){
        t.swf = false;
        if(!ver) ver = 0;
        var n = navigator;
        if(n.plugins && n.plugins.length > 0){
            var m,tp,d,v;
            m = n.mimeTypes;
            tp = 'application/x-shockwave-flash';
            if(m && m[tp] && m[tp].enabledPlugin && m[tp].enabledPlugin.description){
                d = m[tp].enabledPlugin.description;
                v = d.charAt(d.indexOf('.')-1);
                t.swf = (v >= ver) ? true : false;
            }
        }else if(n.appVersion.indexOf("Mac") == -1 && window.execScript){
            for(var i=ver; i<=7&&i!=1&&t.swf!=true; i++){
                execScript('on error resume next: flash.swf=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash'+((i==0)?'':'.'+i)+'"))','VBScript');
                //alert(t.swf);

            }
            if(t.swf) {
                activeX = true;
                //alert('poo is true');
          }


        }else{
            t.swf = false;
        }
        return t.swf;
    }
    t.getPluginTag = function(swfFile,width,height,bgcolor,ver,altFormat,params){
        var s = '';
        var safari = (navigator.userAgent.toLowerCase().indexOf('safari') != - 1);
        var win = (navigator.appVersion.toLowerCase().indexOf("win")!=-1);
        var ie = (navigator.appName=="Microsoft Internet Explorer");
        if(t.hasVersion(ver) && swfFile || (win && ie && swfFile && t.ieAutoInstall)){
            var additionalParams = '';
            if(params && params.length>0){
                var pArray = params.split(",");
                for(var i=0; i<pArray.length; i++){
                    var ta = pArray[i].substr(0,pArray[i].indexOf('='));
                    var v = pArray[i].substr(pArray[i].indexOf('=')+1,pArray[i].length);
                    additionalParams += (activeX)?'\t<param name="' + ta + '" value="' + v + '" />\n': ' '+ ta + '="' + v + '"';
                }
            }
            if(activeX){
                s = '<object id="flashObj" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,21,0" width="'+width+'" height="'+height+'">\n';
                s += '\t<param name="movie" value="'+swfFile+'" />\n';
                s += '\t<param name="quality" value="high" />\n';
                s += '\t<param name="menu" value="false" />\n';
                s += '\t<param name="bgcolor" value="'+bgcolor+'" />\n';
                s += additionalParams;
                s += altFormat;
                s += '</object>\n';
                return s;
            }else{
                s = '<embed id="flashObj" src="'+swfFile+'" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'"'+additionalParams+(safari?' class="safari"':'')+'></embed>\n';
                return s;
            }
        }else{
            return altFormat;
        }
    }
    t.embedMovie = function(swfFile,width,height,bgcolor,ver,altFormat,params){
        document.write(flash.getPluginTag(swfFile,width,height,bgcolor,ver,altFormat,params));
        }
}
var flash = new FlashLibrary();  