



// Create arrays of articles
syndicate.article_title = new Array;
syndicate.article_url = new Array;
syndicate.article_date = new Array;
syndicate.article_summary = new Array;
syndicate.article_content = new Array;

// This section of the script is published by the software
syndicate.index = 0;
  syndicate.article_title[ syndicate.index ] = 'Sabres, Sharks swap Campbell for Bernier';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Buffalo_Sabres_129/Sabres_Sharks_swap_Campbell_for_Bernier.htm';
  syndicate.article_date[ syndicate.index ] = 'Feb 26, 2008 - 6:00:30 PM';
  syndicate.article_summary[ syndicate.index ] = 'Last week in New York City, Brian Campbell happened into a restaurant where a few San Jose Sharks were having dinner during their road trip. Buffalo\'s All-Star defenseman said hello to several acquiantances, including childhood buddy Joe Thornton.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Thrashers romp to run Sabres\' skid to 6';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Atlanta_Thrashers_133/Thrashers_romp_to_run_Sabres_skid_to_6.htm';
  syndicate.article_date[ syndicate.index ] = 'Jan 6, 2008 - 4:43:32 PM';
  syndicate.article_summary[ syndicate.index ] = 'Marian Hossa broke out of a slump with two goals and Atlanta beat Buffalo 5-2 on Sunday to extend the Sabres\' longest losing streak in almost two years.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Sabres C Roy signs 6-year, $24 million deal, avoids arbitration';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Buffalo_Sabres_129/Sabres_C_Roy_signs_6-year_24_million_deal_avoids_arbitration.htm';
  syndicate.article_date[ syndicate.index ] = 'Jul 27, 2007 - 12:33:10 PM';
  syndicate.article_summary[ syndicate.index ] = 'Sabres forward Derek Roy avoided NHL arbitration on Friday by agreeing to a six-year, $24 million contract with Buffalo.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Sabres match Oilers\' offer for Vanek';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Buffalo_Sabres_129/Sabres_match_Oilers_offer_for_Vanek.htm';
  syndicate.article_date[ syndicate.index ] = 'Jul 6, 2007 - 5:34:01 PM';
  syndicate.article_summary[ syndicate.index ] = 'The Buffalo Sabres, still stunned at the loss of co-captains Chris Drury and Daniel Briere to free agency, made sure Friday that high-scoring youngster Thomas Vanek would not also be getting away.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Sabres re-sign coach Ruff, GM Regier';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Buffalo_Sabres_129/Sabres_re-sign_coach_Ruff_GM_Regier.htm';
  syndicate.article_date[ syndicate.index ] = 'Jun 14, 2007 - 8:52:30 PM';
  syndicate.article_summary[ syndicate.index ] = 'The Sabres\' managing partner went out of his way to compliment the loyalty of coach Lindy Ruff and general manager Darcy Regier after both re-signed with Buffalo for below market rate on Thursday.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Miller saves Sabres\' season with win';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Buffalo_Sabres_129/Miller_saves_Sabres_season_with_win.htm';
  syndicate.article_date[ syndicate.index ] = 'May 17, 2007 - 5:51:18 AM';
  syndicate.article_summary[ syndicate.index ] = 'Ryan Miller prevented the Buffalo Sabres from being swept out of the playoffs. Yet, the Presidents\' Trophy winners still have a long way to go to climb back into the Eastern Conference finals against the Ottawa Senators. One step at a time, Miller said after stopping 31 shots - including 15 in the third period - to preserve a 3-2 win in Game 4 on Wednesday night.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Senators edge Sabres, lead series 3-0';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Ottawa_Senators_131/Senators_edge_Sabres_lead_series_3-0.htm';
  syndicate.article_date[ syndicate.index ] = 'May 14, 2007 - 9:17:26 PM';
  syndicate.article_summary[ syndicate.index ] = 'Another opportune bounce, a sharp goalie and a stifling defense pushed the Ottawa Senators within a win of their first trip to the Stanley Cup finals.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Senators strike 1st for 1-0 series lead';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Ottawa_Senators_131/Senators_strike_1st_for_1-0_series_lead.htm';
  syndicate.article_date[ syndicate.index ] = 'May 10, 2007 - 9:08:36 PM';
  syndicate.article_summary[ syndicate.index ] = 'Oleg Saprykin helped the Ottawa Senators further shed their label as underachievers and get a jump on the rival Buffalo Sabres. After Ottawa squandered a two-goal lead, Saprykin snapped a tie 7:41 into the third period of a 5-2 win Thursday in the opener of the Eastern Conference finals.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Sabres knock Rangers out with 5-4 win';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Buffalo_Sabres_129/Sabres_knock_Rangers_out_with_5-4_win.htm';
  syndicate.article_date[ syndicate.index ] = 'May 6, 2007 - 8:33:04 PM';
  syndicate.article_summary[ syndicate.index ] = 'Chris Drury had a goal and assist in the Buffalo Sabres\' four-goal second period that erased an early deficit and sent the team to a 5-4 victory Sunday over the New York Rangers in Game 6 of the conference semifinal series. Ryan Miller preserved the win with 32 saves, including 11 in a frantic third period.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Sabres stun Rangers for 3-2 series lead';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Buffalo_Sabres_129/Sabres_stun_Rangers_for_3-2_series_lead.htm';
  syndicate.article_date[ syndicate.index ] = 'May 5, 2007 - 11:20:08 AM';
  syndicate.article_summary[ syndicate.index ] = 'Benched one game, the overtime star the next: Maxim Afinogenov sure knows how to make up for miscues.';
  syndicate.index++;




// Set defaults for arguments if user hasn't set them
if (syndicate.title_fontface == null)    { syndicate.title_fontface = 'Geneva, Arial, sans-serif'; }
if (syndicate.title_fontsize == null)    { syndicate.title_fontsize = '2'; }
if (syndicate.title_fontcolor == null)   { syndicate.title_fontcolor = '#003366'; }
if (syndicate.title_fontbold == null)    { syndicate.title_fontbold = true; }
if (syndicate.title_fontital == null)    { syndicate.title_fontital = false; }
if (syndicate.date_fontface == null)     { syndicate.date_fontface = 'Geneva, Arial, sans-serif'; }
if (syndicate.date_fontsize == null)     { syndicate.date_fontsize = '1'; }
if (syndicate.date_fontcolor == null)    { syndicate.date_fontcolor = '#6699cc'; }
if (syndicate.date_fontbold == null)     { syndicate.date_fontbold = false; }
if (syndicate.date_fontital == null)     { syndicate.date_fontital = false; }
if (syndicate.date_fontunder == null)    { syndicate.date_fontunder = false; }
if (syndicate.summary_fontface == null)  { syndicate.summary_fontface = 'Geneva, Arial, sans-serif'; }
if (syndicate.summary_fontsize == null)  { syndicate.summary_fontsize = '2'; }
if (syndicate.summary_fontcolor == null) { syndicate.summary_fontcolor = '#6699cc'; }
if (syndicate.summary_fontbold == null)  { syndicate.summary_fontbold = false; }
if (syndicate.summary_fontital == null)  { syndicate.summary_fontital = false; }
if (syndicate.summary_fontunder == null) { syndicate.summary_fontunder = false; }

if (syndicate.title_maxlength == null)   { syndicate.title_maxlength = 0; }
if (syndicate.summary_maxlength == null) { syndicate.summary_maxlength = 0; }

if (syndicate.bgcolor == null)           { syndicate.bgcolor = '#ffffff'; }
if (!syndicate.max_articles)             { syndicate.max_articles = syndicate.article_title.length; }  // !syndicate.max_articles catches null and zero
if (syndicate.display_date == null)      { syndicate.display_date = true; }
if (syndicate.display_summaries == null) { syndicate.display_summaries = true; }


// Don't allow user to display too many articles
if (syndicate.max_articles > syndicate.article_title.length) {
  syndicate.max_articles = syndicate.article_title.length;
}

/*
//Function to crop text on word boundaries
function crop_text(text, max_length) {

  // If the string is already small enough, return it unscathed
  if (text.length <= max_length) { return( text ); }

  // If the user has specified a length of 0, it means he wants the whole thing
  if (max_length == 0) { return( text ); }

  // Start looking for a space, leaving space for an elipsis on the end
  var test_length = (max_length - 3);
  if (test_length < 1) { return( '...' ); }   // max_length too small
  while (text.charAt(test_length) != ' ') {
    test_length--;

    // If we didn't find any spaces to break on, return the string broken at max_length
    if (test_length == 0) { return( text.substring(0, max_length - 3) + '...' ); }
  }

  return text.substring(0, test_length) + '...';
}
*/

// List our articles, stopping if the user doesn't want any more
for ( syndicate.index = 0; syndicate.index < syndicate.max_articles ; syndicate.index++ ) {

  /*syndicate.article_title[syndicate.index] = crop_text(syndicate.article_title[syndicate.index], syndicate.title_maxlength);
  syndicate.article_summary[syndicate.index] = crop_text(syndicate.article_summary[syndicate.index], syndicate.summary_maxlength);*/

  document.write('<tr><td bgcolor="' + syndicate.bgcolor + '">');
  document.write('<a href="' + syndicate.article_url[syndicate.index] + '">');
  if (syndicate.title_fontbold)  { document.write('<b>'); }
  if (syndicate.title_fontital)  { document.write('<i>'); }
  document.write('<font color="' + syndicate.title_fontcolor + '" face="' + syndicate.title_fontface + '" size="' + syndicate.title_fontsize + '"');
  if (syndicate.title_style)     { document.write(' style="' + syndicate.title_style + '"'); }
  document.write('>');
  document.write(syndicate.article_title[syndicate.index]);
  document.write('<br></font>');
  if (syndicate.title_fontital)  { document.write('</i>'); }
  if (syndicate.title_fontbold)  { document.write('</b>'); }
  document.write('</a>');

  if (syndicate.display_date) {
    if (syndicate.date_fontbold)  { document.write('<b>'); }
    if (syndicate.date_fontital)  { document.write('<i>'); }
    if (syndicate.date_fontunder) { document.write('<u>'); }
    document.write('<font color="' + syndicate.date_fontcolor + '" face="' + syndicate.date_fontface + '" size="' + syndicate.date_fontsize + '"');
    if (syndicate.date_style)     { document.write(' style="' + syndicate.date_style + '"'); }
    document.write('>');
    document.write(syndicate.article_date[syndicate.index]);
    document.write('<br></font>');
    if (syndicate.date_fontunder) { document.write('</u>'); }
    if (syndicate.date_fontital)  { document.write('</i>'); }
    if (syndicate.date_fontbold)  { document.write('</b>'); }
  }

  if (syndicate.display_summaries) {
    if (syndicate.summary_fontbold)  { document.write('<b>'); }
    if (syndicate.summary_fontital)  { document.write('<i>'); }
    if (syndicate.summary_fontunder) { document.write('<u>'); }
    document.write('<font color="' + syndicate.summary_fontcolor + '" face="' + syndicate.summary_fontface + '" size="' + syndicate.summary_fontsize + '"');
    if (syndicate.summary_style)     { document.write(' style="' + syndicate.summary_style + '"'); }
    document.write('>');
    document.write(syndicate.article_summary[syndicate.index]);
    document.write('<br></font>');
    if (syndicate.summary_fontunder) { document.write('</u>'); }
    if (syndicate.summary_fontital)  { document.write('</i>'); }
    if (syndicate.summary_fontbold)  { document.write('</b>'); }
  }

  document.write('<br></td></tr>\n');
}

// If you want your Webfeeds to be branded, uncomment the following lines.
// To do this, remove the // at the beginning of the next five lines:

//document.write('<tr><td bgcolor="' + syndicate.bgcolor + '">');
//document.write('<a href="#" target="_blank">');
//document.write('<font color="' + syndicate.title_fontcolor + '" face="Verdana, Arial, Helvetica, sans-serif" size="1">');
//document.write('<p><b>Powered by YourSite.com</b></font></a>');
//document.write('<br><br></b></font></td></tr>\n');
