
  // load global_article array with articles from cluster
  if (article != null)
    {
    for (var article_counter = 0; article_counter < Math.min(3,article.length); article_counter++)
      {
      global_article[global_article_counter] = article[article_counter]
      global_article_counter++
      }
    }
  else
    {
    if (early_exit == 0)
      {
      document.writeln("<center>Please reload this page to view the headlines</center>")
      early_exit = 1
      }
    }
  
  if (early_exit == 0)
  {
  var width = "196"
  var category = ""
  var numberofarticles = global_article.length
  var item_spacing = "1"
  var cluster_bgcolor = "ffffff"
  var cluster_border = "0"
  var heading_display = "No"
  var time_display = "No"
  var cell_spacing = "0"
  var cell_padding = "0"
  var heading_bgcolor
  var heading_font
  var heading_font_size
  var heading_fgcolor
  var headline_bgcolor
  var headline_font
  var headline_font_size
  var headline_fgcolor
  var source_font
  var source_font_size
  var source_fgcolor
  var access_font
  var access_font_size
  var access_fgcolor
  var time_font
  var time_font_size
  var time_fgcolor
  var time = new Array(global_article.length)

  // Print out the table containing the headlines
  document.writeln("<CENTER><TABLE BORDER="+cluster_border+" BGCOLOR='#"+cluster_bgcolor+"' WIDTH='"+width+"' CELLPADDING=2 CELLSPACING=0>")
  
  document.writeln("<TR><TD><CENTER><TABLE BGCOLOR='#"+cluster_bgcolor+"' CELLPADDING="+cell_padding+" CELLSPACING="+cell_spacing+"  WIDTH='100%'>")

  // Start loop for articles
  for (var counter=0; counter < numberofarticles; counter++)
    {
    // Reset formatting settings to original values
    heading_bgcolor = "ffffff"
    heading_font = "Verdana, Arial,Helvetica, sans-serif"
    heading_font_size = "-1"
    heading_fgcolor = "333333"
    headline_bgcolor = "ffffff"
    headline_font = "Verdana, Arial,Helvetica, sans-serif"
    headline_font_size = "-2"
    headline_fgcolor = "333333"
    source_font = "Verdana, Arial,Helvetica, sans-serif"
    source_font_size = "-3"
    source_fgcolor = "ff6600"
    access_font = "Verdana, Arial,Helvetica, sans-serif"
    access_font_size = "-3"
    access_fgcolor = "ff6600"
    time_font = "Verdana, Arial,Helvetica, sans-serif"
    time_font_size = "-3"
    time_fgcolor = "ff6600"

    // Check for new category
    if ((category != global_article[counter].cluster) && (heading_display == "Yes"))
      {
      // Set current category to new category
      category = global_article[counter].cluster

      // Print a new category heading
      document.writeln("<TR BGCOLOR='#"+heading_bgcolor+"'><TD>")
      document.writeln("<FONT SIZE="+heading_font_size+" FACE="+heading_font+" COLOR='#"+heading_fgcolor+"'>")
      document.writeln("<B>"+global_article[counter].cluster+"</B></FONT></TD></TR>")
      }

    // Print out the headline
    document.writeln("<TR BGCOLOR='#"+headline_bgcolor+"'><TD><A HREF="+global_article[counter].url+" TARGET=_blank>")
    document.writeln("<FONT SIZE="+headline_font_size+" FACE="+headline_font+" COLOR='#"+headline_fgcolor+"'")
    document.writeln(">"+global_article[counter].headline_text+"...</FONT></A><br>")

    // Print out the source
    document.writeln("<A HREF="+global_article[counter].document_url+" TARGET=_blank>")
    document.writeln("<FONT FACE="+source_font+" SIZE="+source_font_size+" COLOR='#"+source_fgcolor+"'>")
    document.writeln(""+global_article[counter].source+"</FONT></A>")

    // Print out reg/sub if appropriate
    if (global_article[counter].access_status == "sub" || global_article[counter].access_status == "reg")
      {
      document.writeln(" <A HREF='"+global_article[counter].access_registration+"'>")
      document.writeln("<FONT FACE="+access_font+" SIZE="+access_font_size)
      document.writeln(" COLOR='#"+access_fgcolor+"'>"+global_article[counter].access_status+"</FONT></A>")
      }

    // Print out the harvest time
    if (time_display == "Yes")
      {
      // Make a new date object
      time[counter] = new Date(global_article[counter].harvest_time)
      time[counter].setHours(time[counter].getHours() - (time[counter].getTimezoneOffset() / 60 )) // adjust the time to local
      document.writeln("<FONT FACE="+time_font+" SIZE="+time_font_size+" COLOR='#"+time_fgcolor+"'>")
      document.writeln("&nbsp;&nbsp;"+time[counter].toString()+"</FONT>")
      } 

    document.writeln("</TD></TR><TR BGCOLOR='#"+headline_bgcolor+"'><TD BGCOLOR='#"+headline_bgcolor+"' HEIGHT="+item_spacing+"></TD></TR>")
    } // End of article loop

  document.writeln("</TABLE></CENTER></TD></TR></TABLE></CENTER>")

  // ************************************************************************************
  // This code is subject to the copyright and warranty restrictions detailed at 
  // http://w.moreover.com/wizard_copyright.html
  // Copyright 1999 Moreover.com Inc. All rights reserved.
  // *************************************************************************************
  } 


