var ie = typeof(ActiveXObject) == 'function';
var pop;


window.onunload = function() { window.clearTimeout(xid); if (xdnw) xdnw.close(); if (pop) pop.close() }

var xid,xdni,xdno,xdns,xdnw,xsp;

function xdn_setup() {
 xdni = document.getElementById('xdn_inner');
 xdno = document.getElementById('xdn_outer');
 xsp = (window.frames['xdn'].document.body.getAttribute('speed') * 25);
 xdni.innerHTML = window.frames['xdn'].document.body.innerHTML;
 xdni.onmouseover = function() { window.clearTimeout(xid); xid = null }
 xdni.onmouseout  = function() { if (!xid) xid = window.setTimeout('xdn_scroll()',100) }
 if (ie) {
  xdni.onclick = xdn_open;
  if (xdno.filters[0]) xdno.onfilterchange = function() { if (xdno.filters[0].status == 1) if (!xid) xid = window.setTimeout('xdn_scroll()',500) } }
 else
  xdni.addEventListener('click',xdn_open,false);
 xdns = xdno.offsetHeight - xdni.offsetHeight;
 xdn_reset()
}

function xdn_reset() {
 if (ie && xdno.filters[0]) {
  xdno.style.visibility = 'hidden';
  xdno.filters[0].apply() }
 xdni.style.top = 0;
 xdno.style.visibility = 'visible';
 xid = null;
 if (ie && xdno.filters[0]) {
  xdno.filters[0].play(1.5) }
 else
  xid = window.setTimeout('xdn_scroll()',500)
}

function xdn_scroll() {
 var p = parseInt(xdni.style.top);
 if (p > xdns) {
  xdni.style.top = --p;
  xid = window.setTimeout('xdn_scroll()',xsp) }
 else
  xid = window.setTimeout('xdn_reset()',2500)
}

function xdn_open(eve) {
 if (ie) var e = window.event.srcElement; else var e = eve.target;
 if (e != this) {
  if (e.tagName == 'A') return;
  while (e.parentNode != this) e = e.parentNode;
  var w = (window.screen.width - 410) / 2;
  var h = (window.screen.height - 336) / 2;
  var r = '<html><head><title>Noticias</title>'
        + '<link href="css/xdn.css" rel="stylesheet" type="text/css">'
        + '</head><body>' + e.innerHTML +'</body></html>';
  xdnw = window.open('','_xdn','scrollbars=Yes,height=200,width=300,left='+ w +',top='+ h);
  with (xdnw) {
   document.write(r);
   document.close();
   if (ie) document.onselectstart = function() { return false }
   focus() } }
}


