function obtM2() {
  var divs = document.getElementsByTagName("div");
  for(var i=0;i<divs.length;i++) {
    if(divs[i].className.indexOf("espacioNoticias")>=0) {
      return divs[i];
    }
  }
  return null;
}

//if(window.captureEvents) window.captureEvents(Event.LOAD);
var noticias;

var delayb4scroll = 2000; 
var marqueespeed = 1;
var pauseit = 1;

var copyspeed = marqueespeed;
var pausespeed = (pauseit==0)?copyspeed:0;
var actualheight = '';

function scrollmarquee() {
  var elem1, elem2, elem3, elem4, elem5, elem6;
  elem1 = document.getElementById("noticS1");
  elem2 = document.getElementById("noticS2");
  elem3 = document.getElementById("noticS3");
  elem4 = document.getElementById("noticS4");
  elem5 = document.getElementById("noticS5");
  elem6 = document.getElementById("noticS6");
  
  if (parseInt(elem1.style.top)>-100)
    elem1.style.top=parseInt(elem1.style.top)-copyspeed+"px";
    // << subir scr
  else // o reset
    elem1.style.top=(582)+"px";
  
  if (parseInt(elem2.style.top)>-100)
    elem2.style.top=parseInt(elem2.style.top)-copyspeed+"px";
    // << subir scr
  else // o reset
    elem2.style.top=(582)+"px";
  
  if (parseInt(elem3.style.top)>-100)
    elem3.style.top=parseInt(elem3.style.top)-copyspeed+"px";
    // << subir scr
  else // o reset
    elem3.style.top=(582)+"px";
  
  
  if (parseInt(elem4.style.top)>-100)
    elem4.style.top=parseInt(elem4.style.top)-copyspeed+"px";
    // << subir scr
  else // o reset
    elem4.style.top=(582)+"px";
  
  if (parseInt(elem5.style.top)>-100)
    elem5.style.top=parseInt(elem5.style.top)-copyspeed+"px";
    // << subir scr
  else // o reset
    elem5.style.top=(582)+"px";
  
  if (parseInt(elem6.style.top)>-100)
    elem6.style.top=parseInt(elem6.style.top)-copyspeed+"px";
    // << subir scr
  else // o reset
    elem6.style.top=(582)+"px";

  /*if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
    cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px";
    // << subir scr
  else // o reset
    cross_marquee.style.top=(parseInt(marqueeheight)+8)+"px";
  */
}

var lefttime;

function initializemarquee(){
  cross_marquee=document.getElementById("vmarquee");
  cross_marquee.style.top=0;
  marqueeheight=document.getElementById("marqueecontainer").offsetHeight;
  actualheight=cross_marquee.offsetHeight;
  /*if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1) {
    cross_marquee.style.height=marqueeheight+"px";
    cross_marquee.style.overflow="scroll";
    cross_marquee.style.overflowX="hidden";
    return;
  }*/
  document.getElementById("hmq").onmouseover=function() {copyspeed=pausespeed};
  document.getElementById("hmq").onmouseout=function() {copyspeed=marqueespeed};
  setTimeout('lefttime=setInterval("scrollmarquee()",50)', delayb4scroll);

  // inic adic ln:
  var i;
  noticias = obtM2().getElementsByTagName("li");
  for(i=0; i<noticias.length; i++) {
    noticias[i].getElementsByTagName("a")[0].onmouseover = new Function("window.status = '*' + this.href; this.style.textDecoration = 'underline'; ");
    noticias[i].getElementsByTagName("a")[0].onmouseout = new Function("this.style.textDecoration = 'none'; window.status = '*' + this.href;");
  }

}

if (window.addEventListener)
  window.addEventListener("load", initializemarquee, false);
else if (window.attachEvent)
  window.attachEvent("onload", initializemarquee);
else if (document.getElementById)
  window.onload=initializemarquee;
