pr = new Project();

nResearch = pr.getSize();
var n=6;
var type = new Array(n);
var text = new Array(n);
type[2] = 'm';
text[2] = 'Models';
type[1] = 'f';
text[1] = 'Field';
type[0] = 'c';
text[0] = 'Process';
type[3] = 'mg';
text[3] = 'Modeling';
type[4] = 'r';
text[4] = 'Regulatory Support';
type[5] = 'i';
text[5] = 'Information Pages';

var ttype;

now = new Date();
var mon = now.getMonth() + 1;
var yr = now.getYear();
if (yr<1900) {yr = yr + 1900;}

document.write("<table style=\"width: 100%\">");
//cycle through each type of project
for (k=0;k<type.length;k++)
{
  ttype = type[k];
  document.write("<tr>");
  document.write("<td align=\"left\" valign=\"top\">");
  document.write("<strong>" + text[k] + "</strong>");
  document.write("</td>");
  document.write("</tr>");
  
   

  //There is no sorting, all projects are listed as entered in the projects.js file
  document.write("<ul>");
  document.write("<td align=\"left\" valign=\"top\">");
  document.write("<span class=\"caption\">")
  for (i=0;i<nResearch;i++)
  {
    if (ttype==pr.getFeaturedProject('kind',i+1))
    {
      //document.write("<TR>");
      //document.write("<TD ALIGN=LEFT VALIGN=TOP>");
      document.write("<li>");
      // document.write("<span class=\"caption\">")
      //check for hard coded (1) or relative URL (0)
      if (pr.getFeaturedProject('hardcode',i+1)==0)
      {
        document.write("<a href=" + "'" + pr.getFeaturedProject('web',i+1)+ "'>");   
      }
      else
      {
        document.write("<a href=" + "'" + pr.getFeaturedProject('web',i+1)+ "'>");
      }
      document.write(pr.getFeaturedProject('name',i+1) + "</A>");
      if (pr.getFeaturedProject('year',i+1)==yr && pr.getFeaturedProject('month',i+1)>=mon-1)
      {
        if (pr.getFeaturedProject('datestatus',i+1) == 'n') 
        {
          document.write("<img src=\"images/new.gif\" alt=\"New Graphic\">");
        }
        if (pr.getFeaturedProject('datestatus',i+1) == 'r') 
        {
          document.write("<img src=\"images/revised.gif\" alt=\"Revised Graphic\">");
        }
      }
      document.write("&nbsp; &nbsp;");
      document.write("</font>");
      document.write("</li>");
      //document.write("</TD>");
      //document.write("</TR>");
    }
  }
  document.write("</ul>");
  document.write("</td>");
}
document.write("<tr><td>&nbsp</td><td>&nbsp</td></tr>");
document.write("</table>");
