// ||||||||||||||||||||||||||||||||||||||||||||||||||
// 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 i = image.cloneNode(true);
	i.setAttribute("src",this.href);
	var parent = image.parentNode;
	parent.replaceChild(i, image);
	curNav.style.backgroundColor = "#76934E";
	this.style.backgroundColor = "#92a871";
	curNav = this;
	return false;
}

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

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