/**
	Unless noted otherwise scripts developed by BYU-Idaho Special Collections.  Use by others 
	based on BYU-Idaho,	David O. McKay Library, and BYU-Idaho Special Collections and Archives 
	use statements
**/
function campusBranding(){
//Credits for campus navigation

/** BYU-Idaho Nav Bar (2002)
	Code by: Chris Bailey
	This bar is designed to give our users better navigation throughout the site by: 
	(1) giving them the basic links needed in the menu bar to find their way to wherever they need to go.
	IMPORTANT NOTE:
	IMAGES (unless as backgrounds) AND LAYERS MUST NOT BE USED IN THIS NAVBAR because they disrupt any
	coding that deals with image counts, mouseovers, layer counts, etc.
	The body tag makes sure the nav bar is flush with the top and sides of any web page it's assigned to.
	
	Andrew Bosch 12/2003  New Text based Headers
	updated 04/2004 to include the new smaller logo
**/
document.write("<style>td.ht{ color: white; font-weight: 600; font-family: Arial, sans-serif; font-size: 15px;}</style>");
document.write("<table bgcolor='#58595b' width='100%' border='0' cellpadding='0' cellspacing='0'>");
document.write("<tr>");
document.write("<td width='0'><img height=1 width=4 src='http://www.byui.edu/webstyle/clearspace.gif'></td>");
document.write("<td height=40 background='http://www.byui.edu/webstyle/logo_small.gif'><img height=1 width=85 src='http://www.byui.edu/webstyle/clearspace.gif'></td>");
document.write("<td><img height=1 width=40 src='http://www.byui.edu/webstyle/clearspace.gif'></td>");
document.write("<td width='100%' class=ht>Special Collections and Family History</td>");	
document.write("</tr>");	
document.write("</table>");
}
var widthNum = 0;
function contentsWidth(){
	var currentWidth = document.getElementById("navHead").offsetWidth.toString() + "px";
	var width = document.getElementById("navHead").offsetWidth;
	document.getElementById("bannerImage").style.clip = "rect(0px " + currentWidth + " 60px 0px)";
	document.getElementById("bannerImage").style.top = document.getElementById("imageHolder").offsetTop;
	if (width <= 650){
		document.getElementById("contents").style.width = "100%";
	}
	if (width > 650){
		document.getElementById("contents").style.width = "650px";
	}
}
function getWidth(){
	widthNum = document.getElementById("homecontents").offsetWidth
	var currentWidth = widthNum.toString() + "px";
	//document.getElementById("bannerImage").style.clip = "rect(0px " + currentWidth + " 62px 0px)";
	//document.getElementById("bannerImage").style.top = document.getElementById("imageHolder").offsetTop;
	prepareHeader(widthNum);
}
function prepareHeader(){
	var pictureWidths = new Array(415, 76, 112, 61, 58, 166, 240, 301, 62);
	var margins = new Array(0, 415, 491, 603, 664, 722, 888, 1128, 1429);
	var pictureURL = new Array("cspori" , "cwatch", "cglassesbook", "cmanuscript", "cgrant", "cgradclass", "cbooklayout", "cb2", "cemma");
	var widthsum = 0;
	var i = 0;
	document.getElementById("imageHolder").innerHTML = "";
	while (widthsum < widthNum){
		widthsum = widthsum + pictureWidths[i];
		i++;
	}
	var HTMLstring = "";
	for (var x=0; x < i-1; x++){
		HTMLstring = HTMLstring + "<img src='images/header/" + pictureURL[x] + ".gif' style='margin-left:" + margins[x].toString() + "px;'>";
	}
	HTMLstring = HTMLstring + "&nbsp;"
	//alert(HTMLstring);
	document.getElementById("imageHolder").innerHTML = HTMLstring;
}
function footer(){
document.write("<div id='footer' style='border-top:1px solid #c8b96d'>");
document.write("<span><a href='http://abish.byui.edu/specialcollections/spchome.htm'>BYU-Idaho Special Collections</a> | <a href='http://sc.lib.byu.edu'>BYU ");
document.write("(Provo) L. Tom Perry Special Collections</a> | <a href='http://w3.byuh.edu/library/resource/archives/index.htm'>BYU-");
document.write("Hawaii Special Collections</a> | <a href='http://www.lds.org/churchhistory/archives'>LDS Church Archives</a></span>");
document.write("<span>BYU-Idaho Special");
document.write("Collections:<a href='http://www.byui.edu/maps/default.asp?bldg=9'> McKay Library</a> <a href='http://www.lib.byui.edu/Maps_ContentRight_2ndWest.htm'>240A</a>, Rexburg, ID 83460 | ");
document.write("<a href='mailto:familyhistory@byui.edu'>familyhistory@byui.edu</a><br>");
document.write("Archives: (208) 496-2986 | Family History Lab: (208) 496-2386 </span>");
document.write("<span>&copy;2004 <a href='http://www.byui.edu'>BYU-Idaho</a> and <a href='http://www.lib.byui.edu'>David");
document.write("O. McKay Library</a>, All Rights Reserved</span></div>");
}
function spcNav(section){
document.write("<table id='navHead' cellpadding='0' cellspacing='0' width='100%'><tr>");
document.write("<td class='navLeft'>&nbsp;</td>");
document.write("<td class='spacer'><img src='images/1px.gif'></td>");
document.write("<td class='inactiveTab' id='home1tab'><a href='home1.htm'>Home</a></td>");
document.write("<td class='spacer'><img src='images/1px.gif'></td>");
document.write("<td class='inactiveTab' id='campustab'><a href='campus.htm'>Campus Records</a></td>");
document.write("<td class='spacer'><img src='images/1px.gif'></td>");
document.write("<td class='inactiveTab' id='idahotab'><a href='SEIdaho.htm'>Southeast Idaho</a></td>");
document.write("<td class='spacer'><img src='images/1px.gif'></td>");
document.write("<td class='inactiveTab' id='westerntab'><a href='westernStates.htm'>Western States</a></td>");
document.write("<td class='spacer'><img src='images/1px.gif'></td>");
document.write("<td class='inactiveTab' id='churchtab'><a href='church.htm'>LDS Church</a></td>");
document.write("<td class='spacer'><img src='images/1px.gif'></td>");
document.write("<td class='inactiveTab' id='fhctab'><a href='newFHC.htm'>Family History</a></td>");
document.write("<td class='spacer'><img src='images/1px.gif'></td>");
document.write("<td class='navRight'>&nbsp;</td>");
document.write("</tr></table>");
	if (section != null){
		document.getElementById(section + "tab").className = "activeTab";
	}
}