



// 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 ] = 'COOKE WINS HIS FOURTH CANADIAN MEN’S SENIOR TITLE';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/COOKE_WINS_HIS_FOURTH_CANADIAN_MEN_S_SENIOR_TITLE.cfm';
  syndicate.article_date[ syndicate.index ] = 'Sep 4, 2009 - 6:35:12 PM';
  syndicate.article_summary[ syndicate.index ] = 'It was a close race to the finish line that saw three stellar golfers battle it out for national supremacy, but in the end Graham Cooke of Hudson, Que., came out on top at the 48th Canadian Men’s Senior Championship conducted by the Royal Canadian Golf Association (RCGA).';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'BRITISH COLUMBIA CLAIMS GOVERNORS CUP AT CANADIAN MEN’S SENIOR CHAMPIONSHIP ';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/BRITISH_COLUMBIA_CLAIMS_GOVERNORS_CUP_AT_CANADIAN_MEN_S_SENIOR_CHAMPIONSHIP.cfm';
  syndicate.article_date[ syndicate.index ] = 'Sep 2, 2009 - 9:06:56 PM';
  syndicate.article_summary[ syndicate.index ] = 'Team British Columbia combined for a team-total 440 today at Gorge Vale Golf Club in Victoria to win the Governors Cup inter-provincial team title at the 48th playing of the Canadian Men\'s Senior Championship.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'GORGE VALE GOLF CLUB SET TO HOST CANADIAN MEN’S SENIOR CHAMPIONSHIP';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/GORGE_VALE_GOLF_CLUB_SET_TO_HOST_CANADIAN_MEN_S_SENIOR_CHAMPIONSHIP.cfm';
  syndicate.article_date[ syndicate.index ] = 'Aug 28, 2009 - 11:58:18 AM';
  syndicate.article_summary[ syndicate.index ] = 'Canada\'s top senior amateur golfers are headed to Gorge Vale Golf Club from August 31 - September 4, 2009 to battle for the 48th Canadian Men’s Senior Championship title.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Scott Kral sets early pace at 2009 B.C. Amateur Championship ';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/Scott_Kral_sets_early_pace_at_2009_B_C_Amateur_Championship.cfm';
  syndicate.article_date[ syndicate.index ] = 'Jul 14, 2009 - 8:09:44 PM';
  syndicate.article_summary[ syndicate.index ] = 'Scott Kral of Victoria, B.C. fired a sizzling 5-under par 67 to set the early pace at the 108th playing of the B.C. Amateur Championship being played at Duncan Meadows Golf & Country Club in beautiful Duncan, B.C.<br/>\n';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Duncan Meadows Golf & Country Club prepares to host 108th playing of British Columbia Amateur Championship';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/Duncan_Meadows_Golf_Country_Club_prepares_to_host_108th_playing_of_British_Columbia_Amateur_Championship.cfm';
  syndicate.article_date[ syndicate.index ] = 'Jul 14, 2009 - 2:08:11 PM';
  syndicate.article_summary[ syndicate.index ] = 'Duncan Meadows Golf & Country Club in Duncan, B.C. is set to host the 108th playing of the British Columbia Amateur, conducted by the British Columbia (BCGA). One of Canada\'s oldest golf championships, the BC Amateur runs July 14-17 and will crown the province\'s top amateur golfer.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'CANADIAN GOLF TOUR - BRADY SCHNELL GOES WIRE TO WIRE AT SPRING QUALIFYING SCHOOL';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/CANADIAN_GOLF_TOUR_-_BRADY_SCHNELL_GOES_WIRE_TO_WIRE_AT_SPRING_QUALIFYING_SCHOOL.cfm';
  syndicate.article_date[ syndicate.index ] = 'May 29, 2009 - 6:28:17 PM';
  syndicate.article_summary[ syndicate.index ] = 'Brady Schnell shot a final round 70 on Friday to complete a wire-to-wire victory at the Canadian Tour\'s Spring Qualifying School. His four round score of 11 under par 277 earns him the title by one stroke over Matt Marshall who fired a tournament low 66. ';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'CANADIAN GOLF TOUR - BRADY SCHNELL LEADS BY TWO AT SPRING Q-SCHOOL';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/CANADIAN_GOLF_TOUR_-_BRADY_SCHNELL_LEADS_BY_TWO_AT_SPRING_Q-SCHOOL.cfm';
  syndicate.article_date[ syndicate.index ] = 'May 28, 2009 - 6:50:50 PM';
  syndicate.article_summary[ syndicate.index ] = 'PARKSVILLE, B.C.,  - Brady Schnell shot a two under par 70 to hold a two stroke lead over Mike Roters after three rounds of the Canadian Tour’s Spring Qualifying School. ';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'BRADY SCHNELL MAINTAINS ONE STROKE LEAD AT SPRING QUALIFYING SCHOOL';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/BRADY_SCHNELL_MAINTAINS_ONE_STROKE_LEAD_AT_SPRING_QUALIFYING_SCHOOL.cfm';
  syndicate.article_date[ syndicate.index ] = 'May 27, 2009 - 6:03:18 PM';
  syndicate.article_summary[ syndicate.index ] = 'First round leader Brady Schnell shot a two under par 70 to maintain his one stroke lead after two rounds of the Canadian Tour’s Spring Qualifying School.<br/>\n<br/>\n';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'CANADIAN GOLF TOUR - BRADY SCHNELL LEADS SPRING Q-SCHOOL BY ONE';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/CANADIAN_GOLF_TOUR_-_BRADY_SCHNELL_LEADS_SPRING_Q-SCHOOL_BY_ONE.cfm';
  syndicate.article_date[ syndicate.index ] = 'May 26, 2009 - 5:40:46 PM';
  syndicate.article_summary[ syndicate.index ] = 'PARKSVILLE, B.C., - Brady Schnell fired a five under par 67 to hold a one stroke lead over Jae Woo Im and Todd Killingsworth after the first round of the Canadian Tour\'s Spring Qualifying School.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'CANADIAN GOLF TOUR - CANADIAN SWING STARTS for 2009';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/CANADIAN_GOLF_TOUR_-_CANADIAN_SWING_STARTS_for_2009.cfm';
  syndicate.article_date[ syndicate.index ] = 'May 21, 2009 - 7:38:40 AM';
  syndicate.article_summary[ syndicate.index ] = 'The Canadian Swing begins next week in Parksville, B.C., with the Spring Qualifying School where a field of both newcomers and current members are aiming to either earn or improve their status for 2009. ';
  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');
