function highlightLinks(event)
{ 
	var x = event.target ? event.target : event.srcElement;
	while (x && ( x.nodeType == 3 || x.nodeType == 4 || !x.href)) {
		x = x.parentNode;
	}
	
	if (x.href) {
		for (var i =0; i<document.links.length; i++){
			if (document.links[i] != x && document.links[i].href && document.links[i].href == x.href){
				document.links[i].className = 'hovered';
			}
		}
	}
}

function lowlightLinks(event)
{ 
	var x = event.target ? event.target : event.srcElement;
	while (x && ( x.nodeType == 3 || x.nodeType == 4 || !x.href)) {
		x = x.parentNode;
	}

	if (x.href) {
		for (var i =0; i<document.links.length; i++){
			if (document.links[i] != x && document.links[i].href == x.href){
				document.links[i].className = '';
			}
		}
	}
}

function attachToLinks(event)
{ 
	for (var i =0; i<document.links.length; i++){
/*					document.links[i].onmouseover=highlightLinks;
		document.links[i].onmouseout=lowlightLinks;
*/					if(document.links[i].addEventListener ) {
			document.links[i].addEventListener('mouseover',highlightLinks,false);
		} else if( document.links[i].attachEvent ) {
			document.links[i].attachEvent('onmouseover',highlightLinks);
		}

		if(document.links[i].addEventListener ) {
			document.links[i].addEventListener('mouseout',lowlightLinks,false);
		} else if( document.links[i].attachEvent ) {
			document.links[i].attachEvent('onmouseout',lowlightLinks);
		}
	}
}

if( window.addEventListener ) {
	window.addEventListener('load',attachToLinks,false);
} else if( document.addEventListener ) {
	document.addEventListener('load',attachToLinks,false);
} else if( window.attachEvent ) {
	window.attachEvent('onload',attachToLinks);
}		

