/**
 * @author Miguel Castro
 * @version 0.0.1
 * 
 */

 function showSS(link)
 {
 	targetID = document.getElementById('target_image');
	targetTitle = document.getElementById('target_title');
	targetSubtitle = document.getElementById('cover_main_subtitle');
	targetID.src = link.href;
	targetTitle.innerHTML = link.title;
	targetSubtitle.innerHTML = link.rel;
	

	
	
 }
 function initMercury()
 {
 	
	if (!document.getElementsByTagName){ return; }
	
	var anchors = document.getElementsByTagName("a");
	
		for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];

		if (anchor.getAttribute("href") && (anchor.getAttribute("rel") == "Features" || anchor.getAttribute("rel") == "Coberturas" )){
			anchor.onclick = function () {showSS(this); return false;}
		}
	}



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

}
addLoadEvent(initMercury);
 

