
function changeOpac(id, opacity, full) {
	$(id).style.opacity = (opacity / 100);
	$(id).style.filter = "alpha(opacity=" + opacity + ")";
	if (opacity < full)
		setTimeout("changeOpac('" + id + "'," + (opacity + 15) + "," + full + ")", 5);
	else
		$(id).removeAttribute("filter"); 
}



function showLegal() {

	wH = window.innerHeight || (window.document.documentElement.clientHeight || window.document.body.clientHeight);
  wW = window.innerWidth || (window.document.documentElement.clientWidth || window.document.body.clientWidth);

	$("tapa").style.height= wH+"px";
	$("sub-tapa").style.height= wH+"px";
 	$("capa1").style.left = ( Math.floor(wW/2) - 130) + "px";
	$("capa1").style.top = ( Math.floor(wH/2) -30) + "px";

	$("capa1").style.display = "block";
	$("tapa").style.display = "block";
	$("sub-tapa").style.display = "block";
	changeOpac('sub-tapa', 0 , 60);

	return true;
}

function hideLegal() {
	$("capa1").style.display = "none";
	$("tapa").style.display = "none";
	$("sub-tapa").style.display = "none";
	return true;
}

function addEvents() {

	$$('.closeCapa').each (
		function(node) {
			Event.observe(node,"click",function(){ hideLegal(); });
		}
	)

	//Event.observe($('link-legal'),"click",function(){ showLegal(); });
}

Event.observe(window,"load",function(){ addEvents(); });
