



// 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 ] = 'Nevada Bob’s Golf Named Official Partner of CJGA';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/Nevada_Bob_s_Golf_Named_Official_Partner_of_CJGA.cfm';
  syndicate.article_date[ syndicate.index ] = 'Mar 9, 2010 - 12:53:34 PM';
  syndicate.article_summary[ syndicate.index ] = 'The Canadian Junior Golf Association (CJGA) is pleased to announce a three year partnership with Nevada Bob\'s Golf as an Official Partner of the CJGA.<br/>\n';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'GRAHAM DELAET AND LISA MELDRUM EARN TOUR CARDS THROUGH Q-SCHOOL';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/GRAHAM_DELAET_AND_LISA_MELDRUM_EARN_TOUR_CARDS_THROUGH_Q-SCHOOL.cfm';
  syndicate.article_date[ syndicate.index ] = 'Dec 8, 2009 - 4:48:51 PM';
  syndicate.article_summary[ syndicate.index ] = 'DeLaet finishes tied for 8th to join Mike Weir, Stephen Ames and Chris Baryla on 2010 PGA TOUR; Six Canadians earn either full or conditional playing status on 2010 Nationwide Tour via Q-school.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'RCGA NAMES GOLFERS TO 2010 TEAM CANADA';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/RCGA_NAMES_GOLFERS_TO_2010_TEAM_CANADA.cfm';
  syndicate.article_date[ syndicate.index ] = 'Nov 18, 2009 - 12:46:38 PM';
  syndicate.article_summary[ syndicate.index ] = 'The Royal Canadian Golf Association (RCGA) announced today the names of the athletes who have been selected to join Team Canada’s 2010 golf team.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'CANADIAN GOLF TOUR - MORE THAN 100 MEMBERS AND ALUMNI AT SECOND STAGE Q-SCHOOL';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/CANADIAN_GOLF_TOUR_-_MORE_THAN_100_MEMBERS_AND_ALUMNI_AT_SECOND_STAGE_Q-SCHOOL.cfm';
  syndicate.article_date[ syndicate.index ] = 'Nov 17, 2009 - 12:21:19 PM';
  syndicate.article_summary[ syndicate.index ] = 'The second stage of PGA TOUR Q-School begins Wednesday on six fronts across America. More than 100 Canadian Tour members and alumni are in the field and those advancing to final stage receive at least Nationwide Tour status in 2010. <br/>\n';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'CHRIS BARYLA EARNS FIRST WIN AT THE CHATTANOOGA CLASSIC';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/CHRIS_BARYLA_EARNS_FIRST_WIN_AT_THE_CHATTANOOGA_CLASSIC.cfm';
  syndicate.article_date[ syndicate.index ] = 'Oct 13, 2009 - 7:57:27 AM';
  syndicate.article_summary[ syndicate.index ] = 'Chris Baryla fired a 2-under-par 70 in the final round of the Chattanooga Classic presented by Black Creek to finish at 19 under for the week and win by a shot over Troy Kelly.  David Branshaw, Cameron Percy and Vance Veazey finished tied for third at 17-under par. <br/>\n';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'NATIONWIDE TOUR STORYLINES – Week of September 14th 2009';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/NATIONWIDE_TOUR_STORYLINES_Week_of_September_14th_2009.cfm';
  syndicate.article_date[ syndicate.index ] = 'Sep 15, 2009 - 1:04:41 PM';
  syndicate.article_summary[ syndicate.index ] = 'On Sunday, Rickie Fowler wrapped up his impressive amateur career at the Walker Cup at Merion Golf Club in Pennsylvania, then boarded a plane on Monday for Idaho and the Albertsons Boise Open presented by Kraft where he will make his professional debut.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'CANADIAN GOLF TOUR - JAMES LOVE CAPTURES CANADIAN TOUR CHAMPIONSHI';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/CANADIAN_GOLF_TOUR_-_JAMES_LOVE_CAPTURES_CANADIAN_TOUR_CHAMPIONSHI.cfm';
  syndicate.article_date[ syndicate.index ] = 'Sep 7, 2009 - 8:37:47 AM';
  syndicate.article_summary[ syndicate.index ] = 'James Love parred the first playoff hole to defeat Lucas Lee and captured the $250,000 Canadian Tour Championship. It is the Calgary native\'s first Canadian Tour title and considering he was thinking of quitting the game just two months ago, a validating victory.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'SUZANN PETTERSEN WINS 2009 CN CANADIAN WOMEN’S OPEN';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/SUZANN_PETTERSEN_WINS_2009_CN_CANADIAN_WOMEN_S_OPEN.cfm';
  syndicate.article_date[ syndicate.index ] = 'Sep 7, 2009 - 8:35:26 AM';
  syndicate.article_summary[ syndicate.index ] = 'Seven-year LPGA Tour veteran Suzann Pettersen carded a final-round one-under par 70 (65-68-66-70—269, -15) today to win the 2009 CN Canadian Women’s Open at Priddis Greens in Calgary.<br/>\n';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'SUZANN PETTERSEN TAKES 5-STROKE LEAD INTO FINAL ROUND OF CN CANADIAN WOMEN’S OPEN';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/SUZANN_PETTERSEN_TAKES_5-STROKE_LEAD_INTO_FINAL_ROUND_OF_CN_CANADIAN_WOMEN_S_OPEN.cfm';
  syndicate.article_date[ syndicate.index ] = 'Sep 5, 2009 - 8:26:21 PM';
  syndicate.article_summary[ syndicate.index ] = 'Suzann Pettersen is just 18 holes away from capturing her first LPGA Tour win in two seasons after firing a third-round 5-under par 66 to sit at 14-under par at the CN Canadian Women\'s Open.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'SUZANN PETTERSEN AND SONG-HEE KIM TAKE LEAD HEADING INTO MOVING DAY AT CN CANADIAN WOMEN’S OPEN';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/SUZANN_PETTERSEN_AND_SONG-HEE_KIM_TAKE_LEAD_HEADING_INTO_MOVING_DAY_AT_CN_CANADIAN_WOMEN_S_OPEN.cfm';
  syndicate.article_date[ syndicate.index ] = 'Sep 4, 2009 - 8:43:07 PM';
  syndicate.article_summary[ syndicate.index ] = 'Norway\'s Suzann Pettersen (65-68) and South Korea\'s Song-Hee Kim (71-62) share the top of the leaderboard at 9-under-par 133 following second-round play at the 2009 CN Canadian Women\'s Open.';
  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 = '#003399'; }
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] + '" target="_blank">');
  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('<br><br></b></font></td></tr>\n');
