/**
 *
 * @access public
 * @return void
 **/
function setupRollovers() {
	if(!document.getElementsByTagName)
		return;

//  Establish rollover actions for anchor tags that are of class 'rollover'
	var all_links = document.getElementsByTagName('a');
	for (var i = 0; i < all_links.length; i++) {
		var link = all_links[i];
		if(link.className && (' ' + link.className + ' ' ).indexOf(' rollover ') != -1)
			{
			//  If there is an 'img' tag specified...
			if(link.childNodes && link.childNodes.length == 1 && link.childNodes[0].nodeName.toLowerCase() == 'img')
				{
				link.onmouseover = mouseover;
				link.onmouseout = mouseout;
				}  // end if
			}  // end if
		}  // end for
}  // end setupRollovers()


/**
 *
 * @access public
 * @return void
 **/
function findTarget(e){
	// Begin the DOM events part
	var target;

	if(window.event && window.event.srcElement)
		target = window.event.srcElement;
	else if(e && e.target)
		target = e.target;
	if(!target)
		return null;

	while(target != document.body && target.nodeName.toLowerCase() != 'a')
		target = target.parentNode;
	if(target.nodeName.toLowerCase() != 'a')
		return null;

	return target;
}  // end findTarget(e)


/**
 *
 * @access public
 * @return void
 **/
function mouseover(e) {
	var target = findTarget(e);
	if(!target)
		return;

//alert(target);
	// The only child node of the a-tag in target will be an img-tag
//	var img_tag = childNodes[0];

	// Take the src, which names an image called something.ext,
	// make it point to something_over.ext.
	// This is done with a regular expression.
//	img_tag.src = img_tag.src.replace(/(\.[^.]+)$/, '_over$1');
	tmpRightArea = document.getElementById('home-rightArea');
	tmpRightArea.style.display = 'none';
	tmpId = target.id;
//	alert("tmpId " + tmpId);
	tmpNew = document.getElementById('right' + tmpId);
	tmpNew.style.display = "block";

}  // end mouseover


/**
 *
 * @access public
 * @return void
 **/
function mouseout(e) {
	var target = findTarget(e);
	if(!target)
		return;

	// The only child node of the a-tag in target will be an img-tag
//	var img_tag = childNodes[0];

	// Take the src, which names an image called something_over.ext,
	// make it point to something.ext.
	// This is done with a regular expression.
//	img_tag.src = img_tag.src.replace(/_over(\.[^.]+)$/, '$1');
	tmpId = target.id;
//	alert("tmpId " + tmpId);
	tmpNew = document.getElementById('right' + tmpId);
	tmpNew.style.display = "none";
	tmpRightArea = document.getElementById('home-rightArea');
	tmpRightArea.style.display = 'block';

}  // end mouseover


// When the page loads, set up the rollovers
window.onload = setupRollovers;
