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;

document.write("<TABLE 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>");

  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("<FONT SIZE=-1>")
      //use a relative link if it the hardcode is 0, use an absolute URL if hardcode is 1
      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> &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>");
