//---------------------------------------------
// smartRollover
//---------------------------------------------

function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");
		var preImages = new Array();
		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_out.")) {
				preImages[i] = new Image();
				preImages[i].src = images[i].getAttribute("src").replace("_out.", "_over.");
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_out.", "_over."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_over.", "_out."));
				}
			}
		}
	}
}

//---------------------------------------------
// stripedTable
//---------------------------------------------

function stripedTable () {
	var tables = document.getElementsByTagName("table");
	for (var i = 0; i < tables.length; i++) {
		if (tables[i].className.match(/striped/)) {
			stripedSet(tables[i]);
		}
	}
}
function stripedSet (table) {
	var current = "odd";
	var trs = table.getElementsByTagName("tr");
	for (var i = 0; i < trs.length; i++) {
		trs[i].className += " " + current;
		current = current == "even" ? "odd" : "even";
	}
}

//---------------------------------------------
// onLoad
//---------------------------------------------

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
	window.addEventListener("load", stripedTable, false);
} else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
	window.attachEvent("onload", stripedTable);
}

