



// 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 ] = 'Novelis to extend aluminum production in Korea ';
  syndicate.article_url[ syndicate.index ] = 'http://www.steel-grips.com/newsdesk/asia/Novelis_to_extend_aluminum_production_in_Korea.html';
  syndicate.article_date[ syndicate.index ] = 'Nov 21, 2011 - 7:58:55 AM';
  syndicate.article_summary[ syndicate.index ] = 'Novelis Korea Ltd. invests in their aluminum rolling mill in Ulsan/Korea to increase production capacity and to allow rolling of high-grade strip. ';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'ASAS Aluminium investing in homogenization';
  syndicate.article_url[ syndicate.index ] = 'http://www.steel-grips.com/newsdesk/Europe/ASAS_Aluminium_investing_in_homogenization.html';
  syndicate.article_date[ syndicate.index ] = 'Nov 15, 2011 - 10:42:27 AM';
  syndicate.article_summary[ syndicate.index ] = 'Turkish manufacturer Asas Aluminyum Sanayi ve Ticaret A.S. (ASAS) has ordered a continuous homogenizing plant. ';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Slab caster for PT Gunung';
  syndicate.article_url[ syndicate.index ] = 'http://www.steel-grips.com/newsdesk/asia/PT_Gunung_to_produce_their_own_slabs.html';
  syndicate.article_date[ syndicate.index ] = 'Oct 31, 2011 - 11:04:38 AM';
  syndicate.article_summary[ syndicate.index ] = 'At its Bekasi works in the Indonesian province of West Java, PT. Gunung operates a long-product line for the production of sections and wire rods, as well as a flat-product line for the production of heavy plates and pipes. Slabs were ';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Calvert plant sees ramp-up of another mill section ';
  syndicate.article_url[ syndicate.index ] = 'http://www.steel-grips.com/newsdesk/americas/Calvert_plant_sees_ramp-up_of_another_mill_section.html';
  syndicate.article_date[ syndicate.index ] = 'Oct 26, 2011 - 10:31:02 AM';
  syndicate.article_summary[ syndicate.index ] = 'A hot strip annealing and pickling line and a second 20-roll cold rolling mill are ramped up in the Calvert plant of ThyssenKrupp, Alabama to manufacture coils of special widhts. This additional line expands annual capacity to over 200000 t of cold-rolled strip. ';
  syndicate.index++;  syndicate.article_title[ syndicate.index ] = 'Çolakoğlu increases EAF productivity ';
  syndicate.article_url[ syndicate.index ] = 'http://www.steel-grips.com/newsdesk/Europe/olako_lu_increases_EAF_productivity.html';
  syndicate.article_date[ syndicate.index ] = 'Oct 19, 2011 - 2:05:08 PM';
  syndicate.article_summary[ syndicate.index ] = 'Turkish steel producer Çolakoğlu Metalurji A.S. finished modernisation of their No. 1 EAF in their Gebze Plant. The upgrade involved renewing a large part of the mechanical equipment, e.g., the lower and upper shells, gantry, lifting columns and furnace cover. New current conducting electrode arms for electrodes of up to 800 mm in diameter were also installed.<br/>\nShell volume was increased by  around 20%, keeping tap weight constant. The furnace can now produce over 2.5 million t of steel per year. ';
  syndicate.index++;




// Set defaults for arguments if user hasn't set them
if (syndicate.title_fontface == null)    { syndicate.title_fontface = 'Verdana, Arial, sans-serif'; }
if (syndicate.title_fontsize == null)    { syndicate.title_fontsize = '2'; }
if (syndicate.title_fontcolor == null)   { syndicate.title_fontcolor = '#000000'; }
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 = 'Verdana, Arial, sans-serif'; }
if (syndicate.date_fontsize == null)     { syndicate.date_fontsize = '1'; }
if (syndicate.date_fontcolor == null)    { syndicate.date_fontcolor = '#000000'; }
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 = 'Verdana, Arial, sans-serif'; }
if (syndicate.summary_fontsize == null)  { syndicate.summary_fontsize = '2'; }
if (syndicate.summary_fontcolor == null) { syndicate.summary_fontcolor = '#000000'; }
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 = 150; }

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 - 4);
  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 - 4) + ' ...' ); }
  }

  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" style="text-decoration:none;">');
  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>'); }
  }

  if (syndicate.display_summaries) {
    document.write('<font size="1"><br></font>');
  }
  
 document.write('</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="http://www.steel-grips.com" target="_blank" style="text-decoration:none">');
// document.write('<font color="' + syndicate.title_fontcolor + '" face="Verdana, Arial, Helvetica, sans-serif" size="1">');
// document.write('<p><center><b>Powered by STEEL GRIPS</b></center></font></a>');
// document.write('<br></b></font></td></tr>\n');

