
//
// Generate last-modified information
//

function WriteLastMod()
{
	if(document.lastModified) document.writeln("<p align=right><small>Last Updated: " + document.lastModified + "</small></p>");
}

//
// Navigation 
//

function WriteNav()
{	
	//Deduce current page
	var s = new String(document.location);
	var current = s.substring(s.lastIndexOf("/")+1,s.length);
	if(current == "") current="index.html";
	
	//Render the nav bar
	document.writeln("<div class=\"nav\"><center><table cellpadding=\"4\"><tr>");
	WriteLocation("CV","index.shtml",current);
	WriteLocation("Downloads","downloads.html",current);
	WriteLocation("Electrochemistry","electrochem.html",current);
	WriteLocation("Publications","publications.html",current);
	document.writeln("</tr></table></center></div>");
}

function WriteLocation(name,file,current)
{
	var cls, str, rollover;
	if(file == current)
	{
		rollover="";
		cls = "selnavpane";
		str = name;
	}
	else
	{
		cls = "navpane";
		str = "<a target='_top' style='text-decoration: none' href='" + file + "'>" + name + "<\a>";
		rollover="OnMouseOver='this.className=\"hlnavpane\"' OnMouseOut='this.className=\""+cls+"\"'";
	}
	document.writeln("<td class='" + cls + "' "+rollover+" width=150 align=center>" + str + "</td>");
}


//
// Cross-browser DOM interface
//

function SetObjectStyle(obj,style,value)
{
	if(obj && obj.style) obj.style[style]=value;
}


