 // Start of table
 document.write('<table border=0 width=100%>');





// 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 ] = 'Mr Watkins - Maths Homeworks';
  syndicate.article_url[ syndicate.index ] = 'http://newbattle.mgfl.info/artman2/publish/Maths/watkins.shtml';
  syndicate.article_date[ syndicate.index ] = 'Jun 21, 2010';
  syndicate.article_summary[ syndicate.index ] = 'Maths homeworks for Mr Watkins\' classes, including copies of homework sheets&nbsp;that can be downloaded from home if the sheets are lost:&nbsp;<strong>1b7</strong>, <strong>2b4</strong>, <strong>3b1</strong>, <strong>4b6</strong>&nbsp;and <strong>5b6</strong>.<br />\n<br />\n<span style=\"COLOR: #008d00\">Last updated&nbsp;<strong>21st June 2010</strong>.&nbsp; <span style=\"COLOR: #ff0000\">No more homeworks will be set until after the summer.</span></span>';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'World Cup Project 2010';
  syndicate.article_url[ syndicate.index ] = 'http://newbattle.mgfl.info/artman2/publish/news/World_Cup_Project_2010.shtml';
  syndicate.article_date[ syndicate.index ] = 'Jun 12, 2010';
  syndicate.article_summary[ syndicate.index ] = 'All Newbattle S2 pupils are taking part in a Mini World Cup cross-curricular project in PE, Modern Languages and Geography, as part of the national&nbsp;<a href=\"http://www.sendmyfriend.org/one-goal\">1Goal: Send my Friend to School</a>&nbsp;project.&nbsp; Click on the heading above to find out more about what we are doing, or view our PowerPoint presentations about <a href=\"http://newbattle.mgfl.info/artman2/uploads/1/worldcup1.ppt\">which countries&nbsp;each S2 homeroom is studying</a>&nbsp;and our <a href=\"http://newbattle.mgfl.info/artman2/uploads/1/worldcup2.ppt\">links with South Africa</a>.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'CDT Projects';
  syndicate.article_url[ syndicate.index ] = 'http://newbattle.mgfl.info/artman2/publish/news/CDT_Projects.shtml';
  syndicate.article_date[ syndicate.index ] = 'Jun 07, 2010';
  syndicate.article_summary[ syndicate.index ] = 'View a <a href=\"http://www.newbattle.org.uk/Departments/CDT/Resources/finalprojects2010.ppt\">PowerPoint presentation </a>of some of the excellent work produced by S4 Craft and Design students this year';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Practice Word Choice Questions';
  syndicate.article_url[ syndicate.index ] = 'http://newbattle.mgfl.info/artman2/publish/English/Practice_Word_Choice_Questions.shtml';
  syndicate.article_date[ syndicate.index ] = 'May 06, 2010';
  syndicate.article_summary[ syndicate.index ] = '\n\n<p>Questions to practice word choice.</p>';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Practice Linking Questions Int 1';
  syndicate.article_url[ syndicate.index ] = 'http://newbattle.mgfl.info/artman2/publish/English/Practice_Linking_Questions_Int_1.shtml';
  syndicate.article_date[ syndicate.index ] = 'May 06, 2010';
  syndicate.article_summary[ syndicate.index ] = 'Some questions to practice linking questions.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Int 1 Evidence and analysis revision sheets';
  syndicate.article_url[ syndicate.index ] = 'http://newbattle.mgfl.info/artman2/publish/English/Int_1_Evidence_and_analysis_revision_sheets.shtml';
  syndicate.article_date[ syndicate.index ] = 'Apr 30, 2010';
  syndicate.article_summary[ syndicate.index ] = 'Use these sheets to learn quotations and practice analysis.';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Higher Maths Revision';
  syndicate.article_url[ syndicate.index ] = 'http://newbattle.mgfl.info/artman2/publish/Maths/Higher_Maths_Revision.shtml';
  syndicate.article_date[ syndicate.index ] = 'Apr 19, 2010';
  syndicate.article_summary[ syndicate.index ] = 'Mr Watkins has uploaded some materials to support pupils revising for Higher maths - go to our <a href=\"http://www.newbattle.org.uk/Departments/Maths/higher.html\">Higher maths page</a>';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Personal Study Resit Notes - updated';
  syndicate.article_url[ syndicate.index ] = 'http://newbattle.mgfl.info/artman2/publish/English/Personal_Study_Resit_Notes.shtml';
  syndicate.article_date[ syndicate.index ] = 'Mar 05, 2010';
  syndicate.article_summary[ syndicate.index ] = '';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'War Photographer Practice Essay';
  syndicate.article_url[ syndicate.index ] = 'http://newbattle.mgfl.info/artman2/publish/English/War_Photographer_Practice_Essay.shtml';
  syndicate.article_date[ syndicate.index ] = 'Mar 03, 2010';
  syndicate.article_summary[ syndicate.index ] = '';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'World Maths Day';
  syndicate.article_url[ syndicate.index ] = 'http://newbattle.mgfl.info/artman2/publish/Maths/World_Maths_Day.shtml';
  syndicate.article_date[ syndicate.index ] = 'Mar 01, 2010';
  syndicate.article_summary[ syndicate.index ] = 'All S1 maths classes will be taking part in the World Maths Day Challenge this week - you can log in to the site here:&nbsp;<a href=\"http://www.worldmathsday.com/\">http://www.worldmathsday.com/</a>';
  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('<p><b>Powered by Newbattle CHS</b></font></a>');
//document.write('<br><br></b></font></td></tr>\n');

 // End of table
document.write('</table>');
