// ||||||||||||||||||||||||||||||||||||||||||||||||||
// hat tip to squidie: http://www.squidfingers.com
// onLoadListener

onLoadFuncs = new Array();
function addOnLoad(func){
	onLoadFuncs[onLoadFuncs.length] = func;
}
function runOnLoad(){
	for(i in onLoadFuncs){
		eval(onLoadFuncs[i]+"()");
	}
}
window.onload = runOnLoad;

// ||||||||||||||||||||||||||||||||||||||||||||||||||
// Fix Explorer Mac overflow bug

function beforeOnLoad(){
	var agent = navigator.userAgent.toLowerCase(); 
	if(agent.indexOf("mac") != -1 && document.all && document.getElementsByTagName){
		if(document.body.clientHeight > 500){
			document.getElementsByTagName("body")[0].style.overflow = "hidden";
		}
	}
}

// ||||||||||||||||||||||||||||||||||||||||||||||||||


// Example: addOnLoad("someFunction");

// ||||||||||||||||||||||||||||||||||||||||||||||||||
// Creating a new image element will force the browser
// to redraw the image. Simple image src swaping will not.

function doNav(){
	var image = document.getElementById("image");
	var newimage = document.createElement("img");
	var parent = image.parentNode;
	parent.replaceChild(newimage, image);
	newimage.setAttribute("id","image");
	newimage.setAttribute("src",this.href);
	newimage.setAttribute("width",image.getAttribute("width"));
	newimage.setAttribute("height",image.getAttribute("height"));
	curNav.style.color = "#717171";
	curNav.style.background = "#cccccc";
	this.style.color = "#dddddd";
	this.style.background = "#333333";
	curNav = this;
	return false;
	
}

// ||||||||||||||||||||||||||||||||||||||||||||||||||

function attachNav(){
	var i, e;
	for(i = 1; i <= imageTotal; i ++){
		e = document.getElementById("pic"+i);
		e.onclick = doNav;
		if(i == 1) curNav = e;
	}
}
if(document.getElementById){
	addOnLoad("attachNav");
}

///matt's window pop
function pop(url) { 
	popWindow=window.open(url, 'pop', 'width=500,height=400,scrollbars=yes,resizable=yes');
	popWindow.focus();
}