function TrailerMenu()
{
  var item = 8;
  var menu = new Array(	"Home",		"index.html",	
			"Vision", 	"vision.html",
			"People",	"people.html",
			"Publications",	"publications.html",
			"Projects", 	"projects.html",
			"Sponsors",	"sponsors.html",
			"Links", 	"links.html",
			"Contact", 	"contact.html");

  var msg = "";

  for (i=0;i<item;i++)
  {
    if (document.URL.indexOf(menu[2*i+1])!=-1) msg += menu[2*i];
    else  msg += "<A HREF='" +menu[2*i+1]+ "'>" +menu[2*i]+ "</A>";

    if (i != item-1) msg += "&nbsp;|&nbsp;";
  }

  return msg;
}

function TrailerImage()
{
  var msg = "<A HREF='style.html'>" +
	    "<IMG SRC='vcss.gif' ALT='Made with CSS!' " +
	    "WIDTH=88 HEIGHT=31 BORDER=0 ALIGN=LEFT>" +
	    "</A>";

  return msg;
}

function TrailerDate()
{
  var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");

  var monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
 
  var then = new Date(document.lastModified);
  /*
  var msg = "Last Updated: " +document.lastModified;
  */
  var msg = "Last Updated: " 
	  + dayNames[then.getDay()] + ", " 
	  + monthNames[then.getMonth()] +" "+ then.getDate() +", " 
	  + then.getFullYear() + " - "
	  + then.getHours() +":"+ then.getMinutes() +":"+ then.getSeconds()
	  + " EST";	// you know how to get this automatically ?
  
  return msg;
}

function TrailerName()
{
  var msg = "Georgia Tech Networks and Mobile Computing Research Group";

  return msg;
}

function TrailerSelect()
{
  if (document.body.id.indexOf("NONVOLATILE")!=-1) return TrailerName();
  else					 	   return TrailerDate();
}

function TrailerContact()
{
  var adr = "gnan@ece.gatech.edu";

  var msg = "Please send comments or questions to: " +
	    "<A HREF='mailto:" +adr+ "'>" +
	    adr+ "</A>";

  return msg;
}

function TrailerPadding()
{

  document.write("<BR><IMG NAME=DIMG SRC='dummy.gif' WIDTH=1 HEIGHT=1 BORDER=0>");

  var NS4 = (document.layers) ? 1 : 0;
  var im  = document.images["DIMG"];
  if (!im) im  = document.getElementsByTagName("DIMG");
  var y   = (NS4) ? im.y : im.offsetTop; 
  var Y   = (NS4) ? window.innerHeight : document.body.clientHeight;
  var p   = (Y-y>180) ? (Y-y-100) : 80; 

  return p.toString();
}

function WriteTrailer()
{

  var pad = TrailerPadding();

  document.write("<CENTER><TABLE BORDER=0 CELLPADDING=0 WIDTH=500>");

  document.write("<TR><TD CLASS=TR HEIGHT=" +pad+ " VALIGN=BOTTOM ALIGN=CENTER>");
  document.write(TrailerMenu()+ "</TD></TR>");

  document.write("<TR><TD BGCOLOR=#669933>");
  document.write("<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0>");
  document.write("<TR><TD BGCOLOR=#669933 HEIGHT=4></TD></TR>");
  document.write("</TABLE></TD></TR>");

  document.write("<TR><TD ALIGN=CENTER><H6>");
  document.write(TrailerSelect()+"<BR>"+TrailerContact()+ "</H6></TD></TR>");
  //document.write(TrailerName()+"<BR>"+TrailerContact()+ "</H6></TD></TR>");

  document.write("</TABLE></CENTER>");

}

WriteTrailer(); 
