



// 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 ] = 'Rob Cruise named Head Professional at Highland Pacific Golf';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/Rob_Cruise_named_Head_Professional_at_Highland_Pacific_Golf.cfm';
  syndicate.article_date[ syndicate.index ] = 'Dec 12, 2011 - 2:36:50 PM';
  syndicate.article_summary[ syndicate.index ] = 'Rob Cruise has been named Head Professional at Highland Pacific Golf course. Cruise has been with Highland Pacific since the spring of 2010, and will oversee the golf operation at Victoria\'s newest public course.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Arbutus Ridge Golf Club celebrates 25 Year Anniversary, starting with the Free Agent';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/Arbutus_Ridge_Golf_Club_celebrates_25_Year_Anniversary_starting_with_the_Free_Agent.cfm';
  syndicate.article_date[ syndicate.index ] = 'Nov 29, 2011 - 9:26:31 AM';
  syndicate.article_summary[ syndicate.index ] = 'Arbutus Ridge Golf Club is pleased to be celebrating its 25 year anniversary in 2012 with a number of exciting promotions over the coming year.<br/>\n';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Two Canadians Tied For The Lead Heading Into Final Round Of Play At the Royale Cup Canadian Women’s Amateur';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/Two_Canadians_Tied_For_The_Lead_Heading_Into_Final_Round_Of_Play_At_the_Royale_Cup_Canadian_Women_s_Amateur.cfm';
  syndicate.article_date[ syndicate.index ] = 'Jul 21, 2011 - 8:50:27 PM';
  syndicate.article_summary[ syndicate.index ] = 'Second-round leader Vivian Tsui of Markham, Ont., and Paris, Ont. native Jennifer Kirby are tied for the lead at the Royale Cup Canadian Womens Amateur Championship at Duncan Meadows Golf Club in Duncan, B.C.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'VIVIAN TSUI LEADS AFTER TWO ROUNDS AT ROYALE CUP CANADIAN WOMEN’S AMATEUR CHAMPIONSHIP';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/VIVIAN_TSUI_LEADS_AFTER_TWO_ROUNDS_AT_ROYALE_CUP_CANADIAN_WOMEN_S_AMATEUR_CHAMPIONSHIP.cfm';
  syndicate.article_date[ syndicate.index ] = 'Jul 20, 2011 - 9:04:48 PM';
  syndicate.article_summary[ syndicate.index ] = 'Vivian Tsui of Markham, Ont., maintains her 1-stroke lead after carding a second round 1-over par (73) and two-round even-par (144) to lead Royale Cup Canadian Womens Amateur Championship. The host province, Team British Columbia, captured the Inter-Provincial Team Championship at Duncan Meadows Golf Club in Duncan, B.C.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'VIVIAN TSUI LEADS BY TWO AFTER OPENING-ROUND AT ROYALE CUP CANADIAN WOMEN’S AMATEUR CHAMPIONSHP';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/VIVIAN_TSUI_LEADS_BY_TWO_AFTER_OPENING-ROUND_AT_ROYALE_CUP_CANADIAN_WOMEN_S_AMATEUR_CHAMPIONSHP.cfm';
  syndicate.article_date[ syndicate.index ] = 'Jul 19, 2011 - 10:06:51 PM';
  syndicate.article_summary[ syndicate.index ] = 'Vivian Tsui carded an opening-round 1-under par 71 to lead Royale Cup Canadian Womens Amateur Championship while B.C natives Christina Proteau and Kim Evans had solid first rounds to lead their respective divisions at Duncan Meadows Golf Club in Duncan, B.C. ';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Christina Proteau wins her second BC Mid-Amateur Women\'s title';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/Christina_Proteau_wins_her_second_BC_Mid-Amateur_Womens_title.cfm';
  syndicate.article_date[ syndicate.index ] = 'Jul 1, 2011 - 8:55:25 AM';
  syndicate.article_summary[ syndicate.index ] = 'Hometown favourite Christina Proteau carded a final round 3-under par 68 to capture her second BC Mid-Amateur Women\'s Championship at Alberni Golf Club, in Port Alberni.<br/>\n<br/>\n';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'WILSON BATEMAN AND JISOO KEEL VICTORIOUS AT RAIN-SHORTENED CN FUTURE LINKS PACIFIC CHAMPIONSHIP';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/WILSON_BATEMAN_AND_JISOO_KEEL_VICTORIOUS_AT_RAIN-SHORTENED_CN_FUTURE_LINKS_PACIFIC_CHAMPIONSHIP.cfm';
  syndicate.article_date[ syndicate.index ] = 'May 15, 2011 - 2:15:50 PM';
  syndicate.article_summary[ syndicate.index ] = 'Cobble Hill, B.C. (Golf Canada) - Wilson Bateman of Spruce Grove, Alta. and Jisoo Keel of Coquitlam, B.C. captured their respective Junior Boys and Junior Girls division titles at the CN Future Links Pacific Championship.<br/>\n';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'ARBUTUS RIDGE Golf club Set to Host 2011 CN Future Links Pacific Championship ';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/ARBUTUS_RIDGE_Golf_club_Set_to_Host_2011_CN_Future_Links_Pacific_Championship.cfm';
  syndicate.article_date[ syndicate.index ] = 'May 10, 2011 - 11:21:27 AM';
  syndicate.article_summary[ syndicate.index ] = 'Canada\'s top junior golfers will compete in Cobble Hill, B.C. from May 12-15 as CN Future Links begins its 12th championship season with the CN Future Links Pacific Championship at Arbutus Ridge Golf Club.<br/>\n';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Senior Amateur Event Will Add Spice to Island Golf Schedule';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/Senior_Amateur_Event_Will_Add_Spice_to_Island_Golf_Schedule.cfm';
  syndicate.article_date[ syndicate.index ] = 'Mar 9, 2011 - 9:44:21 AM';
  syndicate.article_summary[ syndicate.index ] = 'Highland Pacific is offering an exciting new challenge to the top amateur golfers on Vancouver Island with an inaugural event geared towards men over fifty-five.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'VGT RELEASES 2011 MEMBERSHIP & TOURNAMENT SCHEDULE';
  syndicate.article_url[ syndicate.index ] = 'http://www.canadagolfguide.com/artman/publish/VGT_RELEASES_2011_MEMBERSHIP_TOURNAMENT_SCHEDULE.cfm';
  syndicate.article_date[ syndicate.index ] = 'Feb 2, 2011 - 8:53:13 AM';
  syndicate.article_summary[ syndicate.index ] = 'The Vancouver Golf Tour (VGT) is proud to announce that its 2011 Tournament Schedule is officially released and that registration for 2011 Membership is Now Open. Read More...';
  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');

