// SCRIPT.JS : script file for GRIP website
// By Mathijs Vogelzang, december 2005
// For questions: m.vogelzang@thorax.umcg.nl

function showHeader(thispagename, name)
{
  document.write("<HEAD><TITLE>GRIP: a glucose control system for critically ill patients: " + name +
		 "</TITLE><LINK REL=\"stylesheet\" type=\"text/css\" href=\"style.css\">" +
	 	 "</HEAD>");

  document.write("<BODY>");

  document.write("<DIV class=\"document\"><center><TABLE width=\"80%\" cellpadding=\"0\"" +
		 "cellspacing=\"0\" border=\"0\">" +
		 "<TR height=\"auto\"><TD valign=\"top\" height=\"auto\">");

  document.write("<TABLE cellpadding=\"0\" cellspacing=\"0\" border=\"0\" WIDTH=200px>"+
		 "<TR><TD><div class=\"logo\">");
  showLogo();
  document.write("</div></TD></TR><TR><TD><div class=\"menu\">");
  showMenu(thispagename);
  document.write("</TD></TR><TR><TD><CENTER><BR><FONT COLOR=white>Hosted by:</FONT>");
  document.write("<BR><a href=\"http://sourceforge.net\"><img src=\"http://sflogo.sourceforge.net/sflogo.php?group_id=154516&amp;type=4\" width=\"125\" height=\"37\" border=\"0\" alt=\"SourceForge.net Logo\" /></a></CENTER></TD></TR>");
  document.write("</TABLE>");
  document.write("</TD><TD valign=top>");

  document.write("<DIV class=\"main\">");
}

function showMenuItem(naam, link, level, thispage)
{
  for(i=1;i<level;i++)
    document.write("&nbsp;&nbsp;");
  document.write("- ");
  if(thispage == link)
  {
    document.write("<FONT COLOR=black><I>" + naam + "</I></FONT>");
  }
  else
  {
    document.write("<A HREF=\"" + link + ".htm\">" + naam + "</A>");
  }
  document.write("<BR>");
}

function showMenu(thispagename)
{
  document.write("<B>Index</B><P>");
  showMenuItem("Main", "index", 1, thispagename);
  showMenuItem("Download", "download", 1, thispagename);
  showMenuItem("Background", "background", 1, thispagename);
  showMenuItem("GRIP as a CDSS", "cdss", 2, thispagename);
  showMenuItem("Publications", "pubs", 2, thispagename);
  showMenuItem("Screenshots", "shots", 1, thispagename);
  showMenuItem("Live demo", "demo", 1, thispagename);
}

function showLogo()
{
  document.write("<CENTER><IMG SRC=\"images/griplogo.png\">");
 document.write("<BR><B><U>G</U></B>lucose <B><U>R</U></B>egulation<BR>for <B><U>I</U></B>ntensive care<BR><B><U>P</U></B>atients</CENTER>");
}

function showFooter()
{
  document.write("<BR><SMALL><CENTER><HR WIDTH=\"30%\">Contact us: <A HREF=\"mailto:info@grip.umcg.nl\">info@grip.umcg.nl</A></CENTER></SMALL></div></TD></TR></TABLE></center></DIV>");
  document.write("</BODY></HTML><DIV STYLE=\"display:none\">");
}
