 var contentcount = news.length;
 if (contentcount == 0)
 {
     contentcount = images.length;
 }


var rotatorArray = new Array(contentcount);

var i=0; 

   for (i = 0;i<contentcount;i++)
   {
   
    
     
		rotatorArray[i] = new initRotator(news[i],links[i],images[i]).write();
	
   }
   
var text = 0;
var timerID;

function changeText() {
  
  
  if (contentcount > 0) {

	 document.getElementById('descript').innerHTML = rotatorArray[text]; 
   	 text++;
  }
  
  if (text == contentcount) {text = 0; }  // change the # 4 at the left to the maximum # of message lines you want included
   timerID = setTimeout("changeText()", 4500); }  // change the # on the left to adjust the speed of the
                                               // scroll. The smaller the # the faster the speed

// Multiple onload function created by: Simon Willison
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function() {
  changeText();
});



function pauseNews() {
      if (timerID != null) {
         clearTimeout(timerID);
         timerID = null;
      }
   }
   
   function playNews() {
      if (timerID == null) {
         timerID = setTimeout('changeText()', 4500);
      }
   }


function fillRotator(){
   var str = '';
   
   
	if (this.link != undefined)
	{
	str += '<a href="' + this.link + '">';

	}

	if (this.img != "")
	{
	str += '<img border="0" src="' + this.img + '"></a><br>';
	}

	if (this.copy != undefined)
	{
	str += this.copy + '<br>';
	}
	

      return str;
}



function initRotator(c,l,i){

      this.copy = c;
      this.link = l;
      this.img = i;
      this.write = fillRotator;
  
  }


