function initPage() {
	initButtons();
}
function initButtons()
{
	var menu = document.getElementById("nav");
	if(menu) {
		var list = menu.getElementsByTagName("a");
		for(var i = 0; i < list.length; i++) {
			list[i].onmousedown = function() {
				if(this.className.indexOf("pressed") == -1) this.className += " pressed";
			}
			list[i].onmouseup = function() {
				this.className = this.className.replace("pressed","");
			}
			list[i].onmouseout = function() {
				this.className = this.className.replace("pressed","");
			} 
		}
	}
	var buttons = document.getElementsByTagName("a");
	for(var i = 0; i < buttons.length; i++) {
		if(buttons[i].className.indexOf("button") != -1) {
			buttons[i].onmousedown = function() {
				if(this.className.indexOf("pressed") == -1) this.className += " pressed";
			}
			buttons[i].onmouseup = function() {
				this.className = this.className.replace("pressed","");
			}
			buttons[i].onmouseout = function() {
				this.className = this.className.replace("pressed","");
			} 
		}
	}
}
if (window.addEventListener)
	window.addEventListener("load", initPage, false);
else if (window.attachEvent)
	window.attachEvent("onload", initPage)

