// JavaScript Document

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

function prepareRollover() {
	// get all the divs in the document
	var divs = document.getElementsByTagName("div");
	// loop through them
	for (var i=0; i < divs.length; i++) {
		// find the ones with a class of "row"
		if (divs[i].className == "row") {
			var thisdiv = divs[i];
			// check to see if there are links
			if(divs[i].getElementsByTagName("a").length > 0) {
				
				// add mouseover
				
				var links = divs[i].getElementsByTagName("a");
				
				links[0].onmouseover = function() {
					rollover(this);
					
				}
			}
		}
	}
}

function rollover(link) {
	// hide all the images
	var hidedivs = document.getElementsByTagName("div");
	for (var i=0; i < hidedivs.length; i++) {
						
		if (hidedivs[i].className == "row") {
			var hideimage = hidedivs[i].getElementsByTagName("img");
			hideimage[0].className = "hidden";
		}
						
	}

	
	var thisp = link.parentNode;
	var thisdiv = thisp.parentNode;
	// reveal associated image
	if(thisdiv.getElementsByTagName("img").length > 0) { 
		hideimage = thisdiv.getElementsByTagName("img");
		hideimage[0].className = "not";
	}


}


addLoadEvent(prepareRollover);