

/* this fuction opens the main table for the page, draws the header and nav bar */
function setupAndHeader()
{

	document.write("<div align=\"center\">");

	document.write("<table class=\"headertable\">");
	document.write("<tr>");
	document.write("<td align=\"center\">");
	document.write("<a name=\"top\"></a>");
	document.write("<a href=\"http://grangerchronicles.com/\"><img border=\"0\" src=\"headerpic.jpg\" width=\"800\" height=\"200\" alt=\"Lee Ann Eckhardt Smith\"></a>");
	document.write("</td>");
	document.write("</tr>");
	document.write("</table>");

	document.write("<table class=\"menubar\">");
	document.write("<tr>");
	document.write("<td class=\"menuitem\" width=55><a class=\"m_item\" href=\"index.html\" target=\"_top\">Home</a></td>");
	document.write("<td class=\"menuitem\" width=55><a class=\"m_item\" href=\"books.html\" target=\"_top\">Books</a></td>");
	document.write("<td class=\"menuitem\" width=195><a class=\"m_item\" href=\"articles.html\" target=\"_top\">Articles and Short Stories</a></td>");
	document.write("<td class=\"menuitem\" width=90><a class=\"m_item\" href=\"workshops.html\" target=\"_top\">Workshops</a></td>");
	document.write("<td class=\"menuitem\" width=85><a class=\"m_item\" href=\"history.html\" target=\"_top\">Family Tree</a></td>");
	document.write("<td>&nbsp;</td>");
	document.write("<td class=\"menuitem\" width=48><a class=\"m_item\" href=\"about.html\" target=\"_top\">About</a></td>");
	document.write("<td class=\"menuitem\" width=45><a class=\"m_item\" href=\"links.html\" target=\"_top\">Links</a></td>");
	document.write("<td class=\"menuitem\" width=40><a class=\"m_item\" href=\"contact.html\" target=\"_top\">Contact</a></td>");

	document.write("</tr>");
	document.write("</table>");
	
	document.write("<table class=\"maintext\">");
	document.write("<tr>");
	document.write("<td>");

}

/* this function adds the footer, and closes the main table */
function closeAndFooter()
{
	document.write("</td>");
	document.write("</tr>");
	document.write("</table>");
	
	document.write("<table class=\"footerbar\">");
	document.write("<tr>");
	document.write("<td align=center class=\"menuitem\">All text copyright Lee Ann Eckhardt Smith | <a href=\"sitemap.html\" class=\"m_item\">Sitemap</a></td>");
	document.write("</tr>");
	document.write("</table>");

	document.write("</div>");
}

/* this function generates the side menu for the "books" section */
function booksMenu()
{
	document.write("<td class=\"sidemenu\">");
	document.write("<p>&nbsp;&nbsp;");
	document.write("<p><A class=\"sidemenuitem\" HREF=\"excerpt.pdf\" target=\"_blank\">Read an Excerpt</A>");
	document.write("<p><A class=\"sidemenuitem\" HREF=\"purchase.html\">Purchase a Book</A>");
    	document.write("<p><A class=\"sidemenuitem\" HREF=\"launch.html\">Book Launch Photos</A>");
    	document.write("<p><A class=\"sidemenuitem\" HREF=\"reviews.html\">Book Reviews</A>");
	document.write("</td>");
}

/* this function generates the side menu for the "workshops" section */
function workshopsMenu()
{
	document.write("<td class=\"sidemenu\">");
	document.write("<p>&nbsp;&nbsp;");
	document.write("<p><A class=\"sidemenuitem\" HREF=\"workshopfeedback.html\">Participant Feedback</A>");
	document.write("<p><A class=\"sidemenuitem\" HREF=\"ocsbschedule.html\">OCSB Schedule</A>");
	document.write("<p><A class=\"sidemenuitem\" HREF=\"perthschedule.html\">Perth Schedule</A>");
	document.write("<p><A class=\"sidemenuitem\" HREF=\"tips.html\">Tips for Writing</A>");
	document.write("</td>");
}

/* this function generates the side menu for the "family tree" section */
function familyTreeMenu(withLegend)
{
	document.write("<td class=\"sidemenu\">");
	document.write("<p>&nbsp;&nbsp;");
	document.write("<p><A class=\"sidemenuitem\" HREF=\"history.html\">List of Branches</A>");
	document.write("<p><A class=\"sidemenuitem\" HREF=\"tree-fullscreen.html\">Entire Family Tree</A>");
	document.write("<p><A class=\"sidemenuitem\" HREF=\"photoalbum.html\">Photo Album</A>");
	document.write("<p><A class=\"sidemenuitem\" HREF=\"handwriting.html\">Handwriting Analysis</A>");
	
	if (withLegend)
	{
	    document.write("<p>");
	    legend();
	}
	document.write("</td>");
}

/* function to draw the legend for the tree pages */
function legend()
{
	    document.write("<div style=\"border-width:2px; border-style:solid;border-color:#663300;font-size:.8em;padding:5px;\">");
	    document.write("Legend:<br>");
	    document.write("<font style=\"font-weight:bold;color:#990000\">Double line = marriage</font><br>");
	    document.write("<font style=\"font-weight:bold;color:#990000\">Heavy line = direct lineage</font><br>");
	    document.write("<font style=\"color:#990000\">Light line = siblings (not in direct lineage)</font><br>");
            document.write("<font style=\"color:#0033FF\">Each generation is in a different colour</font><br>");
	    document.write("</div>");
}

/* function to power the booklaunch photo page */
function changePhoto(newPhoto, caption)
{
	document.photoarea.src = "photos/booklaunch/" + newPhoto + ".jpg";
	document.getElementById("photodesc").firstChild.nodeValue = caption;
}

/* function to power the family photo page */
function changeFamilyPhoto(newPhoto, caption, details)
{
	document.photoarea.src = "familytree/familyphotos/" + newPhoto + ".jpg";
//	alert("title is" + document.getElementById("photodesc").firstChild.nodeValue);
	document.getElementById("photodesc").innerHTML = caption;
//	alert("desc is " + document.getElementById("photodetails").firstChild.nodeValue);
	document.getElementById("photodetails").innerHTML = details;
}

