// funções de troca de imagem
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// ----------------------------

// funções para texto rolante
newsclipleft   = 0;
newscliptop    = 0;
newsclipheight = 250; // altura
newsclipwidth  = 438; // largura
newstop        = 59; // topo
newstimer      = 5;
flag_func      = "stop";
command        = "stop";
speed          = 0;
maxdown        = newstop;

function scrollnews(command, speed) {
  if (command != flag_func) {
    if (flag_func != "stop") {
      stopscrollnews(); } 
  }
  flag_func = command;
  if (command == "up") {
    if (newstop > maxup) {
      newscliptop    = newscliptop + speed;
      newsclipheight = newsclipheight + speed;
      newstop        = newstop - speed; }
  } 
  else {
    if (command == "down") {
     if (newstop < maxdown) {
       newscliptop    = newscliptop - speed;
       newsclipheight = newsclipheight - speed;
       newstop        = newstop + speed; }
    }
  }
  newsDiv          = news.style;
  newsDiv.clip     = "rect(" + newscliptop + " 438 " + newsclipheight + " 0)";
  newsDiv.pixelTop = newstop;
  timernews = setTimeout("scrollnews('" + command + "'," + speed + ")", newstimer);
}

function stopscrollnews() {
 clearTimeout(timernews);
 flag_func = "stop";
}
// --------------------------

// funções para mostrar data e hora
var logDomain = "starmedia";
var logChannel = "paginaspersonales";
var logPath = "otros";

function ShowHours() {
 TodaysHour = new Date()
 horas = TodaysHour.getHours()
 minutos = TodaysHour.getMinutes()
 
 if (horas < 10)
  horas= "0" + horas
 if (minutos < 10)
  minutos = "0" + minutos

 document.write(horas+":"+minutos)
}

function ShowTodayDate() {
 now = new Date()
 dia = now.getDate()
 mes = now.getMonth() + 1
 ano = now.getYear()

 if (dia < 10)
  dia = "0" + dia
 switch (mes) {
  case 1: mes = "janeiro"; break;
  case 2: mes = "fevereiro"; break;
  case 3: mes = "março"; break;
  case 4: mes = "abril"; break;
  case 5: mes = "maio"; break;
  case 6: mes = "junho"; break;
  case 7: mes = "julho"; break;
  case 8: mes = "agosto"; break;
  case 9: mes = "setembro"; break;
  case 10: mes = "outubro"; break;
  case 11: mes = "novembro"; break;
  case 12: mes = "dezembro"; break;
 }
 if (ano < 2000)
  ano = "19" + ano

 document.write(dia+" de "+mes+" de "+ano)
}
// -----------------------------
