



// 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 ] = 'Monday Schools Closings';
  syndicate.article_url[ syndicate.index ] = 'http://1170kfaq.com/artman2/publish/News_2/Monday-Schools-Closings.shtml';
  syndicate.article_date[ syndicate.index ] = 'Mar 21, 2010 - 7:33:06 PM';
  syndicate.article_summary[ syndicate.index ] = 'Tulsa (KFAQ)...Here are the latest school closings.(Updated Sunday 3-21-10, 7:30 p.m.) ';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Black Eyed Peas Fans Brace the Storm';
  syndicate.article_url[ syndicate.index ] = 'http://1170kfaq.com/artman2/publish/News_2/Black-Eyed-Peas-Fans-Brace-the-Storm.shtml';
  syndicate.article_date[ syndicate.index ] = 'Mar 21, 2010 - 11:28:31 AM';
  syndicate.article_summary[ syndicate.index ] = 'TULSA (FOX 23) The snowstorm caused a lot of weekend events to be postponed, including the Randy Travis concert that was scheduled at the Hard Rock. However, the show still went strong at the BOK Center as the Black Eyed Peas took the stage.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Church Closings';
  syndicate.article_url[ syndicate.index ] = 'http://1170kfaq.com/artman2/publish/News_2/Church-Closings.shtml';
  syndicate.article_date[ syndicate.index ] = 'Mar 20, 2010 - 6:57:23 PM';
  syndicate.article_summary[ syndicate.index ] = 'TULSA (KFAQ) A number of churches have cancelled Sunday services as a result of the snow storm. The following churches have cancelled services...';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Georgia Tech Over OSU 64-59';
  syndicate.article_url[ syndicate.index ] = 'http://1170kfaq.com/artman2/publish/News_2/Georgia-Tech-Over-OSU-64-59.shtml';
  syndicate.article_date[ syndicate.index ] = 'Mar 19, 2010 - 8:41:38 PM';
  syndicate.article_summary[ syndicate.index ] = 'MILWAUKEE (AP) Gani Lawal scored 14 points, Derrick Favors added 12 points and nine rebounds, and Georgia Tech made 24 of 25 free throws Friday night to hold off seventh-seeded Oklahoma State 64-59 in the first round of the NCAA tournament.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Oklahoma City Bank Robbery';
  syndicate.article_url[ syndicate.index ] = 'http://1170kfaq.com/artman2/publish/News_2/Oklahoma-City-Bank-Robbery.shtml';
  syndicate.article_date[ syndicate.index ] = 'Mar 19, 2010 - 5:48:50 PM';
  syndicate.article_summary[ syndicate.index ] = 'OKLAHOMA CITY (AP) Authorities are searching for armed robber who struck an Oklahoma City bank.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Snow Storm Cancels Clinic';
  syndicate.article_url[ syndicate.index ] = 'http://1170kfaq.com/artman2/publish/News_2/Snow-Storm-Cancels-Clinic.shtml';
  syndicate.article_date[ syndicate.index ] = 'Mar 19, 2010 - 5:47:50 PM';
  syndicate.article_summary[ syndicate.index ] = 'OOLOGAH (AP) State health officials say a meningococcal vaccine clinic set up for students and employees in the Oologah-Talala school district has been canceled because of a possible snowstorm.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'WINTER STORM WARNING';
  syndicate.article_url[ syndicate.index ] = 'http://1170kfaq.com/artman2/publish/News_2/WINTER-STORM-WARNING.shtml';
  syndicate.article_date[ syndicate.index ] = 'Mar 19, 2010 - 4:31:03 PM';
  syndicate.article_summary[ syndicate.index ] = 'TULSA (KFAQ) The National Weather Service has issued a Winter Storm Warning for the Tulsa area from 7 a.m. Saturday until 7 p.m. Sunday.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Tulsa Schools Plan More Cuts';
  syndicate.article_url[ syndicate.index ] = 'http://1170kfaq.com/artman2/publish/News_2/Tulsa-Schools-Plan-More-Cuts.shtml';
  syndicate.article_date[ syndicate.index ] = 'Mar 19, 2010 - 4:07:00 PM';
  syndicate.article_summary[ syndicate.index ] = 'TULSA (KFAQ) The Tulsa Board of Education is set to consider $14 million in personnel cuts as a result of further state budget cuts. In all, almost 350 administrative, support and teacher positions are expected to be cut.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'OSU Prepares for NCAA Opening Round Game';
  syndicate.article_url[ syndicate.index ] = 'http://1170kfaq.com/artman2/publish/News_2/OSU-Prepares-for-NCAA-Opening-Round-Game.shtml';
  syndicate.article_date[ syndicate.index ] = 'Mar 19, 2010 - 9:47:31 AM';
  syndicate.article_summary[ syndicate.index ] = 'MILWAUKEE (AP) -- Put Oklahoma State and Georgia Tech together, and you\'d pretty much have the perfect team.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Trial Delayed in Trooper Case';
  syndicate.article_url[ syndicate.index ] = 'http://1170kfaq.com/artman2/publish/News_2/Trial-Delayed-in-Trooper-Case.shtml';
  syndicate.article_date[ syndicate.index ] = 'Mar 19, 2010 - 9:45:55 AM';
  syndicate.article_summary[ syndicate.index ] = 'OKMULGEE (AP) -- The jury trial of an Oklahoma Highway Patrol trooper who is accused of kicking a handcuffed woman has been delayed.';
  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] + '" >');
  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');
}
