



// 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 ] = 'Nabokov leads Sharks past Stars, 1-0';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/San_Jose_Sharks_151/Nabokov_leads_Sharks_past_Stars_1-0.htm';
  syndicate.article_date[ syndicate.index ] = 'Feb 23, 2009 - 10:32:37 PM';
  syndicate.article_summary[ syndicate.index ] = 'Devin Setoguchi scored with 12:05 remaining, Evgeni Nabokov stopped 29 shots for his 45th career shutout, and the San Jose Sharks extended their winning streak to four games with a 1-0 victory over the Dallas Stars on Monday night.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Avery, Stars parting ways';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Dallas_Stars_148/Avery_Stars_parting_ways.htm';
  syndicate.article_date[ syndicate.index ] = 'Dec 14, 2008 - 12:24:09 PM';
  syndicate.article_summary[ syndicate.index ] = 'Whenever Sean Avery is ready to return to the NHL, it won\'t be with the Dallas Stars.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'NHL suspends Stars\' Avery 6 games for comments';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Dallas_Stars_148/NHL_suspends_Stars_Avery_6_games_for_comments.htm';
  syndicate.article_date[ syndicate.index ] = 'Dec 5, 2008 - 4:00:07 PM';
  syndicate.article_summary[ syndicate.index ] = 'Sean Avery was suspended for six games by NHL commissioner Gary Bettman on Friday after the league\'s most notorious agitator made a crude comment regarding his ex-girlfriends dating other hockey players. Avery already has served two games of the suspension and will miss an additional four, making him eligible to return Dec. 16 against Phoenix, if Dallas Stars management and teammates accept him.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Avery suspended indefinitely by NHL for crude line';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Dallas_Stars_148/Avery_suspended_indefinitely_by_NHL_for_crude_line.htm';
  syndicate.article_date[ syndicate.index ] = 'Dec 3, 2008 - 4:20:42 AM';
  syndicate.article_summary[ syndicate.index ] = 'Sean Avery knows all about the punishment that comes with saying something inflammatory on the ice, from time in the penalty box to having a stick swung at him.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Red Wings oust Stars for 4th Cup trip in 11 years';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Detroit_Red_Wings_139/Red_Wings_oust_Stars_for_4th_Cup_trip_in_11_years.htm';
  syndicate.article_date[ syndicate.index ] = 'May 19, 2008 - 11:24:46 PM';
  syndicate.article_summary[ syndicate.index ] = 'Dominant in the regular season, superb again in the postseason, the Detroit Red Wings are headed back to the Stanley Cup finals. With gusto, too.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Stars avoid sweep, send West finals back to Detroit';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Dallas_Stars_148/Stars_avoid_sweep_send_West_finals_back_to_Detroit.htm';
  syndicate.article_date[ syndicate.index ] = 'May 15, 2008 - 7:36:20 AM';
  syndicate.article_summary[ syndicate.index ] = 'Detroit\'s goal with a guy barely in the crease, if at all, didn\'t count. Dallas\' goal with a guy clearly in the crease did count. Apparently, that\'s what it takes to slow the mighty Red Wings. Loui Ericksson\'s goal about 12 minutes after Detroit\'s was waved off, then third-period goals from Mike Modano and Brenden Morrow sent the Stars past the Red Wings 3-1 on Wednesday night, preventing the Western Conference finals from ending in a sweep.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Datsyuk\'s hat trick leads Red Wings past Stars 5-2';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Detroit_Red_Wings_139/Datsyuk_s_hat_trick_leads_Red_Wings_past_Stars_5-2.htm';
  syndicate.article_date[ syndicate.index ] = 'May 13, 2008 - 12:11:20 AM';
  syndicate.article_summary[ syndicate.index ] = 'This is how ridiculously good the Detroit Red Wings are playing: They lose the NHL\'s top scorer this postseason and their regular-season scoring leader steps up with the first hat trick of his entire career while one of his linemates scores a demoralizing short-handed goal.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Red Wings roll past Stars 4-1 in West finals opener';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Detroit_Red_Wings_139/Red_Wings_roll_past_Stars_4-1_in_West_finals_opener.htm';
  syndicate.article_date[ syndicate.index ] = 'May 9, 2008 - 7:34:48 AM';
  syndicate.article_summary[ syndicate.index ] = 'Johan Franzen, Brian Rafalski and Tomas Holmstrom scored power-play goals for the Detroit Red Wings, who built a big lead in the second period and coasted to a 4-1 win over the Dallas Stars in Game 1 of the Western Conference finals on Thursday night.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Stars beat Sharks in 4 OTs to clinch series';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Dallas_Stars_148/Stars_beat_Sharks_in_4_OTs_to_clinch_series.htm';
  syndicate.article_date[ syndicate.index ] = 'May 5, 2008 - 7:30:34 AM';
  syndicate.article_summary[ syndicate.index ] = 'The Dallas Stars have finally made it back to the Western Conference finals. It took the eighth longest game in NHL history to do it. Brenden Morrow scored a power play goal 9:03 into the fourth overtime as the Stars eliminated the pesky San Jose Sharks 2-1 in a game that ended early Monday morning - the longest game in the NHL playoffs this season, and the longest in San Jose history.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Michalek\'s goal helps Sharks stay alive with win over Stars';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/San_Jose_Sharks_151/Michalek_s_goal_helps_Sharks_stay_alive_with_win_over_Stars.htm';
  syndicate.article_date[ syndicate.index ] = 'May 1, 2008 - 7:11:03 AM';
  syndicate.article_summary[ syndicate.index ] = 'Back to the Shark Tank. Milan Michalek scored on a power play with 16:34 left and San Jose beat Dallas 2-1 on Wednesday night to avoid being swept in the Western Conference semifinals.';
  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');

