// script.js    mark horton architecture    2005.08.31

function getObj(id) {
	//var hdrDocument;
	//if (frames.length == 0) hdrDocument = document;
	//else hdrDocument = frames[0].document;
	if (document.getElementById) 
	{
	   	//return hdrDocument.getElementById(id);
	   	return document.getElementById(id);
 	}
 	else if (document.all) 
	{
	   	//return hdrDocument.all[id];
	   	return document.all[id];
 	}
 	else if (document.layers) 
	{
	   return document.layers[id];
    	}
   
}
function InitHeader(pathString) {
	var temp = pathString.substring(pathString.indexOf("//")+2,pathString.length);
    temp = temp.substring(temp.indexOf("/")+1,temp.length);
	// if anything other than root, then update header
	if (temp.length > 0) {
		var menu = temp.substring(0,temp.indexOf("/"));
		temp = temp.substring(temp.indexOf("/")+1, temp.length);
		getObj(menu + "_hdr").className="menu_hdr_on";
		getObj(menu + "_menu").className="menu_on"; 
		if (temp.length > 0) {
			var subMenu = temp.substring(0, temp.indexOf("/"));
			var menuItem = subMenu + "_menu_item";
			temp = temp.substring(temp.indexOf("/")+1, temp.length);
			getObj(menuItem).className="menu_item_on";
			if (getObj(subMenu)) {
				getObj(subMenu).className="sub_menu_on";
				if (temp.length > 0) {
					getObj(temp.substring(0, temp.indexOf("/"))).className = "sub_menu_item_on";
				}
			}
		}
	}
}
function SwitchImage(num) {
	// first update thumbnail
	var spacer;
	for (var i = 1; i < 7; i++) {
		spacer = getObj('spacer_' + i);
		if (spacer) {
			if (i == num) spacer.className = "thumb_spacer_on";
			else spacer.className = "thumb_spacer_off";
		}
	}
	// then update photo, but if safari, need to load blank image first...
	if (navigator.userAgent.indexOf('Safari') != -1) {
		getObj("photo").src="blank.gif";
	}
	getObj("photo").src="" + num + ".jpg";
	try {
		getObj("photo_lytebox_link").href="" + num + "_large.jpg";
	} catch (e) {}
}