function makeNews(h,l,c,f,i){
   this.headline = h;
   this.link = l;
   this.copy = c;
   this.follow = f;
   this.img = i;
   this.write = writeNews;
}

function writeNews(){
   var str = '';
   str += '<table width="450" style="border: 1px solid #000000" cellpadding="0" cellspacing="0"><tr height="50" valign="center"><td background="/images/rotator/bkgrd_gradient.gif" colspan="3"><table><tr><td width="15px">&nbsp;</td><td height="45" valign="top"><font size="4pt" color="#FFFFFF"><b>' + this.headline + '</b></font></td></tr></table></td></tr>';
   str += '<tr><td  style="border-right: 1px solid #000000" align="center" width="150" height="218"><a href="' + this.link + '"><img border="0" src="' + this.img.src + '"></td><td width="15px">&nbsp;</td>';
   str += '<td valign="top">' + this.copy + '<br><br><a href="' + this.link + '"><span class="link1">[' + this.follow + ']</span></a></td></tr>';
   str += '<tr><td colspan="3" height="27" bordercolor="0" background="/images/rotator/bkgrd_gradient.gif"><table width="100%"><tr><td><font size="3pt" family="Boost SSI" color="#FFFFFF"><b>HEADLINES</b></font></td><td align="right"><a href="javascript: lastNews();"><img src="/images/rotator/arrow_left.gif" alt="last story" name="storypull" width="15" height="16" border="0"></a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <a href="javascript: nextNews();"><img src="/images/rotator/arrow_right.gif" alt="next story" name="storypull" width="15" height="16" border="0"></a></td></tr></table></td></tr></table>'

   return str;
}

var newsArray = new Array();



var image1 = new Image();
image1.src = '/upload_images/echl.jpg';

newsArray[0] = new makeNews(
   'ECHL Web Site Has New Look',
   '/cgi-bin/mpublic.cgi?action=show_news&amp;cat=1&amp;id=16561',
   '<br>The ECHL web site has a new look so please take a few minutes to look around.<br><br>We moved everything over from the old site and have added some new features including the <a target=_blank href=\"http://cluster.leaguestat.com/download.php?client_code=echl&file_path=daily-report/daily-report.html\">Daily Report</a> which can be ...',
   'More',image1).write();



var image2 = new Image();
image2.src = '/upload_images/BradyLeavoldMug.jpg';

newsArray[1] = new makeNews(
   'Victoria Receiving More Contracted Players',
   '/cgi-bin/mpublic.cgi?action=show_news&amp;cat=1&amp;id=16566',
   '<br><b>By Cleve Dheensaw </b><br><a target=_blank href=\"http://www.canada.com/victoriatimescolonist/news/sports/index.html\"><i>© Times Colonist (Victoria) 2008</i></a> <br><br>VICTORIA, British Columbia - <a target=\"_player\" href=\"http://echl.leaguestat.com/stats/player.php?lang_id=en&id=1949\">Brady Leavold</a> wasn\'t planning on ...',
   'More',image2).write();



var image3 = new Image();
image3.src = '/upload_images/DwightHelminenMug.jpg';

newsArray[2] = new makeNews(
   'Helminen Brings Scoring Touch Back From Finland',
   '/cgi-bin/mpublic.cgi?action=show_news&amp;cat=1&amp;id=16565',
   '<br><b>By Chris Fitz Gerald</b><br><a target=_blank href=\"http://www.troyrecord.com\"><i>The Record</i></a><br><br>ALBANY, N.Y. - Last season was a long, but productive winter for Dwight Helminen, who played for the Charlotte Checkers as a rookie in 2004-05, as he played in the Finnish pro league. <br><br>Helminen skated for JYP ...',
   'More',image3).write();



var image4 = new Image();
image4.src = '/upload_images/florida.jpg';

newsArray[3] = new makeNews(
   'Panthers Assign Rookie DeLory To Everblades',
   '/cgi-bin/mpublic.cgi?action=show_news&amp;cat=1&amp;id=16563',
   '<br>ESTERO, Fla. - The Florida Everblades announced that the Florida Panthers of the National Hockey League have assigned rookie defenseman James DeLory to the Everblades.<br><br>The Everblades are the ECHL affiliate of the Panthers and the Carolina Hurricanes of the NHL and the Rochester Americans and the Albany River Rats of the ...',
   'More',image4).write();



var image5 = new Image();
image5.src = '/upload_images/charlotte.jpg';

newsArray[4] = new makeNews(
   'Checkers, MetaLogix, Inc. Announce Partnership',
   '/cgi-bin/mpublic.cgi?action=show_news&amp;cat=1&amp;id=16562',
   '<br>CHARLOTTE, N.C. - The Charlotte Checkers announced that they have a new partnership with MetaLogix, Inc.<br><br>The Checkers are the ECHL affiliate of the New York Rangers of the National Hockey League and the Hartford Wolf Pack of the American Hockey League.<br><br>MetaLogix focuses on delivering specialized products and services ...',
   'More',image5).write();




var nIndex = -1;
var timerID = null;

function rotateNews(){
   nIndex++
   var len = newsArray.length;
   if(nIndex >= len)
      nIndex = 0;
   document.getElementById('stories').innerHTML =
      newsArray[nIndex];


   timerID = setTimeout('rotateNews()',7000);
}

function pauseNews() {
   if (timerID != null) {
      clearTimeout(timerID);
      timerID = null;
   }
}

function playNews() {
   if (timerID == null) {
      timerID = setTimeout('rotateNews()', 1000);
   }
}

function nextNews() {
   nIndex++;
   if (nIndex == 5) {
      nIndex = 0;
   }
   document.getElementById('stories').innerHTML =
      newsArray[nIndex];
}

function lastNews() {
   nIndex--;
   if (nIndex == -1) {
      nIndex = 4;
   }
   document.getElementById('stories').innerHTML =
      newsArray[nIndex];
}

