/***************************************************************************
   File:        garber_menu.js                                                            
   Created:     1/11/2002                                                            
   Author:      Maxim Garber                                                
                Computer Science Department                                 
                University of North Carolina - Chapel Hill                  
                garber@cs.unc.edu                                           
                                                                            
   Description: Functions set up the garber web page.
		    These include methods to set up the banner, nav menu and last modified date.
                
   Note:
                Adding new html code within a document.write call is easy.
                Just make sure to put quotes around every line, commas between
                the lines, and backslashes before any quotes inside the text itself.                                                       

----------------------------------------------------------------------------.
   Copyright 2001 Maxim Garber                                              
   UNC Gama Research Group                                                                                                                
                                                                            
*****************************************************************************/


/****************************************************************************
   Function   : writeBodyHeader
   Description: Writes the <BODY ...> code needed for backgrounds
****************************************************************************/
function writeBody()
{
	document.write(
	"<BODY marginwidth=\"0\" marginheight=\"0\" topmargin=\"0\" leftmargin=\"0\" >"
	);
}

/****************************************************************************
   Function   : writeImageMaps
   Description: Writes the image map code needed for navigation menue
****************************************************************************/
function writeImageMaps()
{	document.write(

		"<map name=\"SideMenuMap\"> ",
		"<area shape=\"rect\" alt=\"\" coords=\"3,183,88,201\" href=\"http://www.maxgarber.com/family/\">",
		"<area shape=\"rect\" alt=\"\" coords=\"3,155,88,173\" href=\"http://www.maxgarber.com/gallery/\">",
		"<area shape=\"rect\" alt=\"\" coords=\"3,127,88,145\" href=\"http://www.maxgarber.com/travel/\">",
		"<area shape=\"rect\" alt=\"\" coords=\"3,99,88,117\"  href=\"http://www.maxgarber.com/hobbies/\">",
		"<area shape=\"rect\" alt=\"\" coords=\"3,70,88,88\"   href=\"http://www.maxgarber.com/papers/\">",
		"<area shape=\"rect\" alt=\"\" coords=\"3,43,88,61\"   href=\"http://www.maxgarber.com/school/\">",
		"<area shape=\"rect\" alt=\"\" coords=\"3,15,88,33\"   href=\"http://www.maxgarber.com/jobs/\">",
		"<area shape=\"rect\" alt=\"\" coords=\"3,0,88,6\"     href=\"http://www.maxgarber.com/projects/\">",
		"</map>",


		"<map name=\"BannerMap\">",
		"<area shape=\"rect\" alt=\"\" coords=\"128,80,219,99\" href=\"http://www.maxgarber.com/resume/\">",
		"<area shape=\"rect\" alt=\"\" coords=\"128,44,234,65\" href=\"http://www.maxgarber.com/aboutme/\">",
  		"<area shape=\"rect\" alt=\"\" coords=\"129,4,216,22\"  href=\"http://www.maxgarber.com\">",
		"<area shape=\"rect\" alt=\"\" coords=\"3,114,88,126\"  href=\"http://www.maxgarber.com/projects/\">",
		"</map>"
	);
}

/****************************************************************************
   Function   : writeTableStart                                                           
   Description: Writes the start of the outer page table and the side and top navigation menues
****************************************************************************/
function writeTableStart()
{
	document.write(
		"<table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">",
		"<tr><td background=\"http://www.maxgarber.com/page_images/Regular-Page_top_background.gif\" colspan=\"2\"><img src=\"http://www.maxgarber.com/page_images/Regular-Page_01.gif\" border=\"0\" usemap=\"#BannerMap\" height=\"126\"></td></tr>",
		"<tr><td background=\"http://www.maxgarber.com/page_images/Regular-Page_right_background.gif\" valign=\"top\" rowspan=\"2\" ><img src=\"http://www.maxgarber.com/page_images/Regular-Page_02.gif\" border=\"0\" usemap=\"#SideMenuMap\"></td>",
		"<td height=\"100%\" width=\"100%\" align=\"left\" valign=\"top\">"

		/* Regular page text goes in here */
	);
}



/****************************************************************************
   Function   : beginPage                                                            
   Description: Generates the banner, using the specified secondary banner image,
                and the side menue for the gamma web page. 
                
                After calling this function, any html code in the page will be 
                contained in one cell of the main page table.
                
                You need to call endPage() to close off the table.
****************************************************************************/
function beginPage()
{
	writeBody();
	writeImageMaps();
	writeTableStart();
}

/****************************************************************************
   Function   : endPage                                                            
   Description: Ends the open table.
****************************************************************************/
function endPage(date)
{
	
	document.write(
		"</td></tr>     ",
		"<tr><td>       ",
		"<center><br><i>",
		"Last modified: ",
		date,
		"</i></center>  ",
		"</td></tr>     ", 
		"</table>       "
	);
}
