var news_line = new Array();
news_line.current = -1;     // To provoke first call
news_line.freeze = 0;       // Swapping allowed
news_line.delay = 5000;     // Time delay between swapping in ms


// Put here the news lines (HTML tags allowed) ---------------------------------
// No lines:   no news showed
// One line:   static news line       news_line[0]='...'
// More lines: news lines will swap   news_line[0]='...', news_line[1]='...', ...
//
//news_line[0] = '<a href="general/Canary.html">Fires on Canary Islands seen from space</a>';
//news_line[0] = '<a href="general/Greece.html">Forest fires on Greece seen from space</a>';
//news_line[2] = '<a href="workshop/index.php">8-9 October 2007 - TEMIS user workshop at ESRIN, Italy</a>';
//news_line[0] = '<a href="http://www.sciam.com/article.cfm?articleID=F2639A2C-E7F2-99DF-3DD84E9A32C6F61E&sc=I100322">TEMIS in the Scientific American</a>';
news_line[1] = '<a href="http://www.temis.nl/protocols/o3hole">Ozone hole and UV radiation forecast bulletin</a>';
//news_line[1] = '<a href="http://www.temis.nl/airpollution/no2col/no2colgome2.php">Near Real Time GOME-2 tropospheric NO2 data</a>';
//news_line[0] = '<a href="http://nl.youtube.com/watch?v=TokBkIvYw58">TEMIS, the movie (on YouTube)</a>';
//news_line[0] = '<a href="http://www.oma.be/BIRA-IASB/Molecules/SO2archive/cases/kasatochi.php">Monitoring the SO2 plume from the Kasatochi volcano</a>';
//news_line[0] = '<a href="http://www.temis.nl/fresco/">FRESCO+ for GOME-2 available</a>';
news_line[0] = '<a href="aviation/Eyjafjalljokull.html">Information about the eruption of the Eyjafjalljokull volcano</a>';
// Make code cross browser proof
function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}


function swap_news() {
    if(news_line.length==0)         // No news: exit
        return; 
        
    if(news_line.current==-1)       // First call: Put 'NEWS' caption
    {
        var newscaption = new getObj('newscaption');
        newscaption.obj.innerHTML = 'NEWS:&nbsp;&nbsp;';
    }

    if(!news_line.freeze)           // Change content only if mouse is not above news bar
    {
        news_line.current ++;
        if(news_line.current > news_line.length-1)
            news_line.current = 0;

        var newsline = new getObj('newsline');
        newsline.obj.innerHTML = news_line[news_line.current];
    }
    
    if (news_line.length>1)         // Recursive call with time delay
        setTimeout("swap_news();",news_line.delay);
}
