// PBoC JavaScript Files
// Check for Compatibility
	// sniff for browser compatability
function sniffBW() {
if (document.getElementById && document.images){
	 // browser safe for DOM functions
}
else if (navigator.appName == "Netscape" && navigator.appVersion <= "6.0"){
	 alert("To view this Web page, please \n enable JavaScript in your browser \n or update your browser.");
}
else {
	alert("To view this Web page, please \n enable JavaScript in your browser \n or update your browser.");
	}
}
//Copyright Date
//Keeps Copyright Date Current
function setCopyDate() {
var dt = new Date();
var copyYear = dt.getFullYear();
document.getElementById("copyline").innerHTML = "Copyright ©" + copyYear + " Garland Science";
}
//Set breadcrumb path
//checks for folder names in URL
function setBCrumb() {
var strURL=(window.location.href);
var chptNum = "";
if (strURL.indexOf('data') > -1){
	if (strURL.indexOf('chapter') > -1){
		chptNum = strURL.substring(strURL.lastIndexOf('chapter') + 7, strURL.lastIndexOf('.'));
		document.getElementById("pbocbreadcrumb").innerHTML = "	<a href='../'>Home</a> > <a href='/data'>Data</a> > Chapter " + chptNum;
	}
	else {
		document.getElementById("pbocbreadcrumb").innerHTML = "	<a href='../'>Home</a> > Data";
	}
}
else if (strURL.indexOf('hints') > -1){
	if (strURL.indexOf('chapter') > -1){
		chptNum = strURL.substring(strURL.lastIndexOf('chapter') + 7, strURL.lastIndexOf('.'));
		document.getElementById("pbocbreadcrumb").innerHTML = "	<a href='../'>Home</a> > <a href='/hints'>Hints</a> > Chapter " + chptNum;
	}
	else {
		document.getElementById("pbocbreadcrumb").innerHTML = "	<a href='../'>Home</a> > Hints";
	}
}
else if (strURL.indexOf('powerpoints') > -1){
	if (strURL.indexOf('chapter') > -1){
		chptNum = strURL.substring(strURL.lastIndexOf('chapter') + 7, strURL.lastIndexOf('.'));
		document.getElementById("pbocbreadcrumb").innerHTML = "	<a href='../'>Home</a> > <a href='/powerpoints'>PowerPoints</a> > Chapter " + chptNum;
	}
	else {
		document.getElementById("pbocbreadcrumb").innerHTML = "	<a href='../'>Home</a> > PowerPoints";
	}
}
else if (strURL.indexOf('jpegs') > -1){
	if (strURL.indexOf('chapter') > -1){
		chptNum = strURL.substring(strURL.lastIndexOf('chapter') + 7, strURL.lastIndexOf('.'));
		document.getElementById("pbocbreadcrumb").innerHTML = "	<a href='../'>Home</a> > <a href='/jpegs'>JPEGs</a> > Chapter " + chptNum;
	}
	else {
		document.getElementById("pbocbreadcrumb").innerHTML = "	<a href='../'>Home</a> > JPEGs";
	}
}
else if (strURL.indexOf('videos') > -1){
	if (strURL.indexOf('chapter') > -1){
		chptNum = strURL.substring(strURL.lastIndexOf('chapter') + 7, strURL.lastIndexOf('.'));
		document.getElementById("pbocbreadcrumb").innerHTML = "	<a href='../'>Home</a> > <a href='/videos'>Videos</a> > Chapter " + chptNum;
	}
	else {
		document.getElementById("pbocbreadcrumb").innerHTML = "	<a href='../'>Home</a> > Videos";
	}
}
else {
		document.getElementById("pbocbreadcrumb").innerHTML = "	<a href='default.html'>Home</a> > ";
}
}
//set active navigation color
function setColor() {
var strURL=(window.location.href);
var chptNum = "";
if (strURL.indexOf('data') > -1){

	if (strURL.indexOf('chapter') > -1){
		chptNum = strURL.substring(strURL.lastIndexOf('chapter'), strURL.lastIndexOf('.'));
		document.getElementById('data').style.backgroundColor = "#e7eaef";
		document.getElementById(chptNum).style.fontWeight = 'bold';
	}
	else {
		document.getElementById('data').style.backgroundColor = "#e7eaef";
	}
}
else if (strURL.indexOf('hints') > -1){

	if (strURL.indexOf('chapter') > -1){
		chptNum = strURL.substring(strURL.lastIndexOf('chapter'), strURL.lastIndexOf('.'));
		document.getElementById('hints').style.backgroundColor = "#e7eaef";
		document.getElementById(chptNum).style.fontWeight = 'bold';
	}
	else {
		document.getElementById('hints').style.backgroundColor = "#e7eaef";
	}
}
else if (strURL.indexOf('powerpoints') > -1){

	if (strURL.indexOf('chapter') > -1){
		chptNum = strURL.substring(strURL.lastIndexOf('chapter'), strURL.lastIndexOf('.'));
		document.getElementById('powerpoints').style.backgroundColor = "#e7eaef";
		document.getElementById(chptNum).style.fontWeight = 'bold';
	}
	else {
		document.getElementById('powerpoints').style.backgroundColor = "#e7eaef";
	}
}
else if (strURL.indexOf('jpegs') > -1){
	
	if (strURL.indexOf('chapter') > -1){
		chptNum = strURL.substring(strURL.lastIndexOf('chapter'), strURL.lastIndexOf('.'));
		document.getElementById('jpegs').style.backgroundColor = "#e7eaef";
		document.getElementById(chptNum).style.fontWeight = 'bold';
	}
	else {
		document.getElementById('jpegs').style.backgroundColor = "#e7eaef";
	}
}
else if (strURL.indexOf('videos') > -1){
	
	if (strURL.indexOf('chapter') > -1){
		chptNum = strURL.substring(strURL.lastIndexOf('chapter'), strURL.lastIndexOf('.'));
		document.getElementById('videos').style.backgroundColor = "#e7eaef";
		document.getElementById(chptNum).style.fontWeight = 'bold';
	}
	else {
		document.getElementById('videos').style.backgroundColor = "#e7eaef";
	}
}
else {
		
}
}
