

function makeNews(c,l,f,i){
      this.copy = c;
      this.link = l;
      this.follow = f;
      this.img = i;
      this.write = writeNews;
   }

function writeNews(){
      var str = '';
      str += '<a href="' + this.link + '">';
      str += '<img border="0" src="' + 
         this.img.src + '"></a><br>';
      str += this.copy + '<br>';
      str +=  '<a href="' + this.link + '">' + 
         this.follow + '</a>';
      return str;
   }

 var listImg = new Image();
   listImg.src = 'http://www.ksg.harvard.edu/taubmancenter/graphics/healthcare.gif';
   var treeImg = new Image();
   treeImg.src = 'http://www.ksg.harvard.edu/taubmancenter/graphics/newspapers.gif';
   var formImg = new Image();
   formImg.src = 'http://www.ksg.harvard.edu/taubmancenter/graphics/managing_crises.gif';
   var autoImg = new Image();
   autoImg.src = 'http://www.ksg.harvard.edu/taubmancenter/graphics/case_award.gif';

var newsArray = new Array();
   newsArray[0] = new makeNews(
       "The Challenge of Sustaining Health Care Reform in Massachusetts",
       'http://www.ksg.harvard.edu/taubmancenter/events.htm',
       'Read More',listImg).write();
   
   newsArray[1] = new makeNews(
      "Taubman Center in the News",
      'http://www.ksg.harvard.edu/taubmancenter/new.htm',
      'More Info',treeImg).write();
   
   newsArray[2] = new makeNews(
      "Managing Crises: Responses to Large-Scale Emergencies",
      'http://www.ksg.harvard.edu/taubmancenter/emergencyprep/index.htm',
      'Full Story',formImg).write();
   
   newsArray[3] = new makeNews(
      "Kennedy School Students Win 2009 Education Leadership Case Competition",
      'http://www.ksg.harvard.edu/taubmancenter/new.htm',
      'More Info',autoImg).write();

var nIndex = 0;
   var timerID = null;
   
   function rotateNews(){
      var len = newsArray.length;
      if(nIndex >= len)
         nIndex = 0;
      document.getElementById('stories').innerHTML = 
         newsArray[nIndex];
      nIndex++;
      timerID = setTimeout('rotateNews()',6000);
   }

function pauseNews() {
      if (timerID != null) {
         clearTimeout(timerID);
         timerID = null;
      }
   }
   
   function playNews() {
      if (timerID == null) {
         timerID = setTimeout('rotateNews()', 1000);
      }
   }

