// JavaScript Document

function showLinks(e) {
	if(!e.attachEvent) e = this;
	if(e.effect) e.effect.cancel();
	e_id = e.id + '-links';
	e.effect = new Effect.Appear(e_id, { duration:.3, to:.85 });
}

// the onload event handler that starts the fading.
function hideLinks(e) {
	if(!e.attachEvent) e = this;
	if(e.effect) e.effect.cancel();
	e_id = e.id + '-links';
	e.effect = new Effect.Fade(e_id, { duration:1.0 });
}

function addListener(watchme) {
	if (watchme.addEventListener) {//DOM method for binding an event
		watchme.addEventListener("mouseover", showLinks, false);
		watchme.addEventListener("mouseout", hideLinks, false); 
	}
	else if (watchme.attachEvent) {//IE exclusive method for binding an event
		watchme.onmouseover = function() { showLinks(this); };
		watchme.onmouseout = function() { hideLinks(this); };
		//watchme.attachEvent("onmouseout", hideLinks); 
	}
	else if (document.getElementById) {//support older modern browsers
		watchme.onmouseover=showLinks;
		watchme.onmouseout=hideLinks; 
	}
}

$$('.watchme').each(function(s) { addListener(s); });