/* 
 * Contains utility functions useful for many different web pages.
 *
 * (c) M. Arthur Munson, 2001
 */

/*-------------------------------------------------------------------
 * Standard output methods.
 *------------------------------------------------------------------*/

/*
 * showModifiedDate():
 * 
 * Parms: doc --- the document for which to show the modified date
 * Returns: none
 * Description: If the last modified date is available, then writes it to
 * the document (at the place where this function is called).  Do not 
 * call this function after the page has finished loading.
 * 
 * Largely stolen from O'Reilly's JavaScript book.
 */
function showModifiedDate(doc){
	if(Date.parse(doc.lastModified) != 0){
		doc.write('<small><i>Last modified: '+doc.lastModified+'</i></small><br />');
	}
}

/*
 * showContact():
 *
 * Parms: 	doc 	--- The document to add contact information to.
 * 		msg	--- The string msg to use (probably an email address).
 * Description: Writes the maintenance information on the page.
 */
function showContact(doc, msg){
	doc.write('<small><i>Maintained by M. Arthur Munson ('+msg+')</i></small><br />');
}

/*
 * showInfo():
 *
 * Parms:	doc	--- The document to add the information to.
 * 		msg	--- The contact message to add.
 * Description:	Writes standard information to the page.
 */
function showInfo(doc, msg){
	showContact(doc, msg);
	showModifiedDate(doc);
}