var isDOM = false, isNS4 = false;
if (document.all) var isDOM = true, docObj = 'document.all.', styObj = '.style';
else if (document.layers) var isNS4 = true, docObj = 'document.', styObj = '';
var quotes = new Array(); c = 0;
quotes[c] = 'Actualidad gallega'; c++;
quotes[c] = 'FM 97.9 Radio Cultura, Buenos Aires, Argentina'; c++;
quotes[c] = 'Agenda de la colectividad'; c++;
quotes[c] = 'Música y noticias'; c++;
quotes[c] = 'Domingos de 12.30 a 14 hs, hora local'; c++;
quotes[c] = 'Entrevistas'; c++;
quotes[c] = 'Toda la información gallega'; c++;
quotes[c] = 'Lingua galega'; c++;
quotes[c] = 'Música'; c++;
quotes[c] = 'Literatura'; c++;
quotes[c] = 'Editoriales'; c++;
quotes[c] = 'Novedades'; c++;
quotes[c] = 'Notas'; c++;
quotes[c] = 'Humor'; c++;
quotes[c] = 'Misceláneas'; c++;
quotes[c] = 'Opinión'; c++;
quotes[c] = 'Xuntanzas'; c++;
quotes[c] = 'Queimada'; c++;
var visQuotes = 18; // Maximum onscreen at once.
var sDivSty = new Array(visQuotes);
var sDivRef = new Array(visQuotes);
var speed = new Array(visQuotes);
var colours = new Array('BDDAE5','AFCCD7','DCE9EE','D8EEF6','C6D3D8','B6DBE8','C3E3EF');
function checkDivs()
{
 for (i = 0; i < visQuotes; i++)
 {
  if (parseInt(sDivSty[i].left) < (0 - (isDOM ? sDivRef[i].clientWidth : sDivSty[i].clip.width)))
  {
   speed[i] = Math.floor(Math.random() * 56) + 8; // Varies: 8 to 63.
   // Off to the right it goes.
   sDivSty[i].left = (isDOM ? document.body.clientWidth : window.innerWidth) + Math.random() * 50;

  divText = '<nobr><span style="font: ' + speed[i] + 'px Arial, Helvetica; ' +
   'color: #' + colours[Math.floor(speed[i] / 8) - 1] + '">' +
   quotes[Math.floor(Math.random() * quotes.length)] + '</span></nobr>';

   fontSize = Math.floor(speed[i] / 8) - 1;
   divText = '<nobr><font face="Verdana, Helvetica" size="' + fontSize + '" color="#' +
    colours[fontSize] + '">' + quotes[Math.floor(Math.random() * quotes.length)] +
    '</font></nobr>';
   if (isDOM) sDivRef[i].innerHTML = divText;
   if (isNS4)
   {
    sDivRef[i].document.write(divText);
    sDivRef[i].document.close();
   }
   sDivSty[i].zIndex = speed[i];
   topMax = (isDOM ? document.body.clientHeight : innerHeight) - speed[i];
   sDivSty[i].top = topMax * Math.random();
  }
  sDivSty[i].left = parseInt(sDivSty[i].left) - (speed[i] / 4);
 }
}
function initDivs()
{
 for (i = 0; i < visQuotes; i++)
 {
  divID = 'sDiv' + i.toString();
  if (isDOM) document.write('<div id="' + divID + '" style="position: absolute; left: -1000">&nbsp;</div>');
  // Have to use layers, divs are buggy as..... in NS. Again.
  if (isNS4) document.write('<layer id="' + divID + '" left="-1000">&nbsp;</layer>');
  sDivRef[i] = eval(docObj + 'sDiv' + i);
  sDivSty[i] = eval(docObj + 'sDiv' + i + styObj);
 }
 setInterval('checkDivs()', 50);
}
if (isDOM || isNS4) initDivs();

