



// 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 ] = 'Ravens eat Bills alive';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Buffalo_Bills_246/Ravens_eat_Bills_alive_1042.htm';
  syndicate.article_date[ syndicate.index ] = 'Oct 25, 2004 - 8:35:00 PM';
  syndicate.article_summary[ syndicate.index ] = 'Drew Bledsoe had more protection than usual. He also rolled out of the pocket once or twice and did the unheard of, took off and ran on one play. One would think that Bledsoe had a productive day, but that certainly was not the case as he threw 4 interceptions and fumbled twice (losing one) as the Bills lost 20-6.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'McGahee leads the way in Bills first win';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Buffalo_Bills_246/McGahee_leads_the_way_in_Bills_first_win_989.htm';
  syndicate.article_date[ syndicate.index ] = 'Oct 18, 2004 - 7:17:00 PM';
  syndicate.article_summary[ syndicate.index ] = 'The Bills-Dolphins rivalry got the spark it needed Sunday in Buffalo when the two teams played a surprisingly interesting game. It was surprising as there were zero wins between the two teams entering the game. The Bills emerged a 20-13 winner, thanks to the running of rookie Willis McGahee and a defense that came together in the second half and shut down the Dolphins offense.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Bills defense fails to halt Jets';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Buffalo_Bills_246/Bills_defense_fails_to_halt_Jets_950.htm';
  syndicate.article_date[ syndicate.index ] = 'Oct 11, 2004 - 8:11:00 PM';
  syndicate.article_summary[ syndicate.index ] = 'Sometimes the difference between winning and losing is something so small that it can\'t be detected. Maybe it\'s a lucky bounce, maybe it\'s the confidence of a quarterback. The Buffalo Bills seem to be on the verge of winning an actual football game. They\'ve come close in all 4 losses. In their game against the Jets, the elements were there to pull a major upset of the New York Jets.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Bumbling Bills botch another one';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Buffalo_Bills_246/Bumbling_Bills_botch_another_one_890.htm';
  syndicate.article_date[ syndicate.index ] = 'Oct 4, 2004 - 8:13:00 PM';
  syndicate.article_summary[ syndicate.index ] = 'Bumbling, stumbling, fumbling....those three words were made famous by Chris Behrman of ESPN\'s Prime Time NFL show. The Bills played up on all three of those infamous words Sunday with yet another loss, their 6th straight, 31-17 to the New England Patriots.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Bills Sinking Fast';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Buffalo_Bills_246/Bills_Sinking_Fast_816.htm';
  syndicate.article_date[ syndicate.index ] = 'Sep 21, 2004 - 7:22:00 AM';
  syndicate.article_summary[ syndicate.index ] = 'Things were supposed to change this season. However, it was more of the same old malarkey as the Buffalo Bills lost to the Oakland Raiders 13-10 Sunday in Oakland.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Bills miscues ruin opening day';
  syndicate.article_url[ syndicate.index ] = 'http://www.mopsquad.com/artman2/publish/Buffalo_Bills_246/Bills_miscues_ruin_opening_day_798.htm';
  syndicate.article_date[ syndicate.index ] = 'Sep 13, 2004 - 7:39:00 PM';
  syndicate.article_summary[ syndicate.index ] = 'It’s a brand new season for the Buffalo Bills, but nothing seems to have changed from last year. The Bills offense is having difficulty in getting into the end zone, the defense cannot stop a team late in the game when the game is on the line, and the team is still making crucial mistakes that should have been corrected in the preseason.';
  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');

