function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function prepareLinks() {
	if (!document.getElementsByTagName) return false;
	var links = document.getElementsByTagName("a");
	for (var i=0; i<links.length; i++) {
		if (links[i].getAttribute("class") == "popup") {
			links[i].onclick = function() {
				popup(this.getAttribute("href"));
				return false;
			}
		}
	}
}

function popup(winURL) {
	window.open(winURL, "popup");
}

function alternate() {
	if (!document.getElementById) return false;
	if (!document.getElementsByTagName) return false;
	if (!document.getElementById("productList")) return false;
	var products = document.getElementById("productList");
	if (!products.getElementsByTagName("dl")) return false;
	var dls = products.getElementsByTagName("dl");
	for (var i=1; i < dls.length; i+=2) {
		dls[i].className = "alt";
	}
}

addLoadEvent(prepareLinks);
addLoadEvent(alternate);