if (document.images) {
  document.preload        = new Array();
  document.preload[1]     = new Image();
  document.preload[1].src = "./gfx/menu_on.gif";
  document.preload[2]     = new Image();
  document.preload[2].src = "./gfx/menu_off.gif";
  url = location.href;
  if(url.indexOf("clientes") == -1) {
    document.preload[3]     = new Image();
    document.preload[3].src = "./gfx/botao_on.gif";
    document.preload[4]     = new Image();
    document.preload[4].src = "./gfx/botao_off.gif";
  }
}

function displayTime()	{
  var stat="w w w . k o l o r b i t . c o m"
  window.status=stat
  setTimeout("displayTime()",150)
}
displayTime(); //mostra as horas na barra status

function textFocus(obj) {
  obj.style.borderColor='#ff0000';
  obj.style.backgroundColor='#f8f8f8';
  obj.style.scrollbarTrackColor='#F8F8F8';
  obj.style.scrollbarHighlightColor='#ff0000';
  obj.style.scrollbarArrowColor='#ff0000';
  obj.style.scrollbarShadowColor='#ff0000';
}

function textBlur(obj) {
  obj.style.borderColor='#00477F';
  obj.style.backgroundColor='#ffffff';
  obj.style.scrollbarTrackColor='#ffffff';
  obj.style.scrollbarHighlightColor='#00477F';
  obj.style.scrollbarArrowColor='#00477F';
  obj.style.scrollbarShadowColor='#00477F';
}

function changeColor(obj,color) {
  document.all[obj+'_1'].style.backgroundColor=color;
  document.all[obj+'_2'].style.backgroundColor=color;
  document.all[obj+'_3'].style.backgroundColor=color;
  document.all[obj+'_4'].style.backgroundColor=color;
}

function flashKolorClear() {
  document.getElementById('kolorbit1').style.color='#E6CCCD';
  document.getElementById('kolorbit2').style.color='#E6CCCD';
  document.getElementById('kolorbit3').style.color='#E6CCCD';
}

function flashKolorOn() {
  document.getElementById(header).style.color='#FFFFFF';
  setTimeout('flashKolorOff()', 50);
}

function flashKolorOff() {
  document.getElementById(header).style.color='#E6CCCD';
  if(it==1) setTimeout('flashKolorOn()', 50);
}

function showDetails(id) {
  window.open('./show_details.php?id='+id,'_blank','width=380,height=280,scrollbars=yes');
}

function openTest() {
  window.open('./speedtest/','speed','width=660, height=560');
}

function bOvr(src) {
  if (!src.contains(event.fromElement)) {
    src.style.backgroundImage = 'url(./gfx/botao_on.gif)';
  }
}

function bOut(src) {
  if (!src.contains(event.toElement)) {
    src.style.backgroundImage = 'url(./gfx/botao_off.gif)';
  }
}

function bClk(src) {
  if(event.srcElement.tagName=='TD'){
    src.children.tags('A')[0].click();
  }
}

/* 
 * You may use this script free of charge under the GNU License
 * as long you keep this banner
 *
 * Powered by Kolorbit.com
 * 26-03-2004
 * www.kolorbit.com
 */

function UpdateClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
   
   if(document.getElementById('clock_delimiter').style.visibility == 'hidden') {
     document.getElementById('clock_delimiter').style.visibility = 'visible';
   } else {
     document.getElementById('clock_delimiter').style.visibility = 'hidden';
   }
   
   segundo = segundo + 1;
   if (segundo == 60) {
     segundo = 0;
     minuto = parseInt(minuto, 10);
     minuto = minuto + 1;
     if (minuto == 60) {
       minuto = 0;
       hora = parseInt(hora, 10);
       hora = hora + 1;
       if (hora == 24) {
         hora = 0;
       }
     }
     hora = parseInt(hora, 10);
     if (minuto < 10 ) minuto = '0'+minuto;
     document.getElementById('clock_minutes').innerHTML = minuto;
     if (hora < 10 ) hora = '0'+hora;
     document.getElementById('clock_hours').innerHTML = hora;
   }

   clockID = setTimeout("UpdateClock()", 1000);
}