   function showLoading(ele,loader){
       if(document.getElementById(ele).innerHTML == ""){
           setTimeout("showLoading('"+ele+"','"+loader+"')",200);
       }else{
           document.getElementById(ele).style.display = 'block';
           document.getElementById(loader).style.display = 'none';
       }
   }      
   function in_array(string, array)
    {
       for (i = 0; i < array.length; i++)
       {
          if(array[i] == string)
          {
             return true;
          }
       }
    return false;
    }  
   function sDetalhes(uid){
        showPage('ajIndex.php?page=udetalhes&uid=' + uid,'aj_container');
        document.getElementById('overlay').style.display = 'block';
        document.getElementById("aj_loader").style.display = 'block';
        setTimeout("showLoading('aj_container')",200);
   }   
   function ramo_servicos(sid){
       document.getElementById('lista_servicos_recomendados').innerHTML = "";
       document.getElementById('selected_2').style.display = 'block';
       document.getElementById("ajLoading").style.display = 'block';
       showPage('ajIndex.php?page=ramo_servicos&sid=' + sid,'lista_servicos_recomendados');
       
       setTimeout("showLoading('lista_servicos_recomendados','ajLoading')",200);
       
   }
 function mostraHint(hintId,callerId){
     document.getElementById(hintId).style.display = 'block';
     document.getElementById(callerId).onclick = function() {escondeHint(hintId,callerId)};
 }
 function escondeHint(hintId,callerId){
     document.getElementById(hintId).style.display = 'none';
     document.getElementById(callerId).onclick = function() {mostraHint(hintId,callerId)};     
 }
    function StopEvent(pE)
{
   if (!pE)
     if (window.event)
    pE = window.event;
     else
    return;
   if (pE.cancelBubble != null)
      pE.cancelBubble = true;
   if (pE.stopPropagation)
      pE.stopPropagation();
   if (pE.preventDefault)
      pE.preventDefault();
   if (window.event)
      pE.returnValue = false;
   if (pE.cancel != null)
      pE.cancel = true;
}  // StopEvent

   function ajaxForm(page,options){
       resetAjaxArea();
        showPage('ajIndex.php?page=' + page + '&' + options,'aj_container');
        document.getElementById('overlay').style.display = 'block';
        document.getElementById("aj_loader").style.display = 'block';
        setTimeout("showLoading('aj_container','aj_loader')",200);
   }   
   function resetAjaxArea() {
        waited = 0;
        document.getElementById('aj_container').innerHTML = ""; 
        document.getElementById('overlay').style.display = 'block';
        document.getElementById("aj_loader").style.display = 'block';
        setTimeout("showLoading('aj_container','aj_loader')",200);                      
   }   
