// ********************************************************************************
// This page contains Javascript funtions used by multiple pages within the website
// Modifying the contents of this page may affect the entire website
// ********************************************************************************

// UNIQUE LINKS
var InstantReference = "http://skagit.cb.docutek.com/ghc/vrl_talk_redir.asp";
var AcademicSearchPremier = "http://graysharbor.library.ctc.edu/cgi-bin/validate.cgi?db=EB&site=GRAYSHARBOR";
var ProQuest = "http://graysharbor.library.ctc.edu/cgi-bin/validate.cgi?db=PQ&site=GRAYSHARBOR";
var SIRS = "http://graysharbor.library.ctc.edu/cgi-bin/validate.cgi?db=SR&site=GRAYSHARBOR";
var NewsBank = "http://graysharbor.library.ctc.edu/cgi-bin/validate.cgi?db=NB&site=GRAYSHARBOR";
var HealthReference = "http://graysharbor.library.ctc.edu/cgi-bin/validate.cgi?db=HR&site=GRAYSHARBOR";
var ContemporaryAuthors = "http://graysharbor.library.ctc.edu/cgi-bin/validate.cgi?db=HR&site=GRAYSHARBOR";
var LiteraryCriticism = "http://graysharbor.library.ctc.edu/cgi-bin/validate.cgi?db=HR&site=GRAYSHARBOR";
var AutoRepair = "http://graysharbor.library.ctc.edu/cgi-bin/validate.cgi?db=EA&site=GRAYSHARBOR";
var EncyclopediaAmericana = "http://graysharbor.library.ctc.edu/cgi-bin/validate.cgi?db=AM&site=GRAYSHARBOR";
var GroilersEncyclopedia = "http://graysharbor.library.ctc.edu/cgi-bin/validate.cgi?db=AM&site=GRAYSHARBOR";
var LitFinder = "http://graysharbor.library.ctc.edu/cgi-bin/validate.cgi?db=PF&site=GRAYSHARBOR";
var CitHelp = "http://ghc.ctc.edu/library/common/cithelp.htm";


// GLOBAL SITE VARIABLES:
var BackGroundColor = "#3366CC";			// Sets master background color
var MasterTableWidth = "895";				// Sets page size
var Alink = "red";
var Vlink = "black";
var Link = "black";

// HEADER SECTION VARIABLES:
var HeadSrcFile = "../images/header1.jpg";		// Sets image used in the header section
var HeadHomeUrl = "../home/index.htm";			// Sets page to load when header is clicked

// NAVIGATION SECTION VARIABLES:
var NavBorderColor = "white";				// Sets border color around nav section         **
var NavBorderLight = "white";				// Sets light border color in the nav section   **
var NavBorderDark = "white";				// Sets dark border color in the nav section    **
var NavBorderSize = "0";					// Sets the border size for the nav section
var NavBgColor = "ffffff";					// Sets background color in nav section 
var NavDefaultCellColor = "#ffcc33";			// Sets cell background in nav section
var NavActiveCellColor = "#ffff00";			// Sets ... not used yet ... 
var NavFontColor = "#000066"; 				// Sets the font color in nav section

// BODY SECTION VARIABLES:
var BodyBgColor = "white";					// Sets background color in the body section    **
var BodyBorderLight = "white";				// Sets light border color in the body section  **
var BodyBorderDark = "white";				// Sets dark border color in the body section   **
var BodyBorderColor = "white";				// Sets border color in the body section        **
var BodyBorderSize = "1";  				// Sets border size around the body section

// FOOTER SECTION VARIABLES:
var FootFontColor = "black";				// Sets font color in the footer section

//*********************************************************************************
// MODIFYING THE FUNCTIONS BELOW MAY CAUSE ERRORS IN THE WEBSITE
//*********************************************************************************

function CreateHeader()
{//v1.0
	document.write("<body bgcolor='" + BackGroundColor + "' background=../images/marble.jpg alink='" + Alink + "' vlink='" + Vlink + "' link='" + Link + "'>");
	document.write("<div align='center'>");
	document.write("<table border='0' width='" + MasterTableWidth + "' bordercolorlight='#CCFFFF' bordercolordark='#66CCFF' bgcolor='FFFFFF' id='table1'>");
	document.write("<tr><td><p align='center'>");
	document.write("<a href='" + HeadHomeUrl + "'>");
	document.write("<img alt='Return to Home Page' border='0' src='"+ HeadSrcFile +"' width='790' height='65' id='img1'>");
	document.write("</a></td></tr>");
	document.write("</table>");	
}

function CreateNav(ActiveTab)
{//v1.0
	var UseColor = NavDefaultCellColor;
	document.write("<div align='center'>");
	document.write("<table border='" + NavBorderSize + "' width='" + MasterTableWidth + "' bordercolor='" + NavBorderColor +"' bgcolor='"+ NavBgColor + "' bordercolorlight='"+ NavBorderDark +"' bordercolordark='"+ NavBorderLight +"' id='table13'>");
	if (ActiveTab == 1)
	{
	UseColor = NavActiveCellColor;
	}
	document.write("<tr><td bgcolor=" + UseColor + " align=center><font color="+ NavFontColor +"> ");
	document.write("<a href='"+ InstantReference +"'><b>Instant Reference</b></a></font></td>");
	UseColor = NavDefaultCellColor;
	if (ActiveTab == 2) 
	{
	UseColor = NavActiveCellColor;
	}
	document.write("<td bgcolor=" + UseColor + " align=center><font color="+ NavFontColor +"> <font size= '3'> ");
	document.write("<a href='../bks/books.htm'><b>Books, DVD's,etc.</b></a></font></td>");
	UseColor = NavDefaultCellColor;
	if (ActiveTab == 3) 
	{
	UseColor = NavActiveCellColor;
	}
	document.write("<td bgcolor=" + UseColor + " align=center><font color="+ NavFontColor +">");
	document.write("<a href='../mag/mag.htm'><b>Magazine & Newspaper Articles</a></b></font></td>");
	UseColor = NavDefaultCellColor;
	if (ActiveTab == 4) 
	{
	UseColor = NavActiveCellColor;
	}
	document.write("<td bgcolor=" + UseColor + " align=center><font color="+ NavFontColor +">");
	document.write("<a href='../ref/ref.htm'><b>Reference Resources</b></a></font></td>");
	UseColor = NavDefaultCellColor;
	if (ActiveTab == 5) 
	{
	UseColor = NavActiveCellColor;
	}
	document.write("<td bgcolor=" + UseColor + " align=center><font color="+ NavFontColor +">");
	document.write("<a href='../reserves/reserves.htm'><b>E-Reserves</b></a></font></td>");
	UseColor = NavDefaultCellColor;
	if (ActiveTab == 6) 
	{
	UseColor = NavActiveCellColor;
	}
	document.write("<td bgcolor=" + UseColor + " align=center><font color="+ NavFontColor +">");
	document.write("<a href='../www/www.htm'><b>World Wide Web</b></a></font></td>");
	UseColor = NavDefaultCellColor;
	document.write("</tr></table>");		
}

function CreateBody(BgColor)
{//v1.0
	var BackgroundColor = BodyBgColor;
	
	if (BgColor == "def")
	{
		BackgroundColor = BodyBgColor;
	} else {
		BackgroundColor = BgColor;
	}
		
	
	document.write("<table border='" + BodyBorderSize + "' bordercolor='" + BodyBorderColor + "' bordercolordark='" + BodyBorderDark + "' bordercolorlight='" + BodyBorderLight + "' bgcolor='" + BackgroundColor + "' width='" + MasterTableWidth + "'><tr><td>");
}

function EndBody()
{//v1.0
	document.write("</td></tr></table>");
}

function CreateFooter(Date)
{//v1.0
	document.write("<div align='center'>");
	document.write("<table  width='" + MasterTableWidth + "'  id='table5' >");
	document.write("<tr><td>");
	document.write("<p align='center'><font color='"+ FootFontColor +"'><font size='2'>");
	document.write("Last updated: " + Date + "</font>");
	document.write("</td><td>");
	document.write("<p align='center'><font color='" + FootFontColor + "'><font size='2'>");
	document.write("©2006 Grays Harbor College John Spellman Library</font>");
	document.write("</td></tr></table></div></div></div></body>");
}

