
function ES_ampliaFoto($foto,$texto,$ancho,$alto) { // By E-S
	$posicion = document.body.scrollTop;
	if ($posicion == 0) { // Calculo posición del Scroll
		if (window.pageYOffset) $posicion = window.pageYOffset;
		else $posicion = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
	}
	$player = document.getElementById('contFoto');
	//$altoPlayer = $player.offsetHeight;
	$altoPlayer = $alto + 30 + $posicion + 175 + 40; // altoFoto + extra + posicion + texto // Si, lo sé, está muy hardcoded.
	$altoPagina = document.body.offsetHeight - 70; //alert($altoPlayer + ' - ' + $altoPagina);
	$htmlFoto = '<img src="' + $foto + '" alt="" />';
	$htmlTexto = '<p>' + $texto + '</p>';
	$htmlExtra = '<a href="" onclick="ES_cierraFoto(); return false;">Cerrar</a>';
	$player.innerHTML = $htmlFoto + $htmlExtra + $htmlTexto; // Armo el player
	$player.className = "contFoto"; // Muestro el player
	$player.style.width = $ancho + 'px'; // Defino el ancho del player
	if ($altoPlayer >= $altoPagina) { 
		$player.style.top = eval($altoPagina - 40 - $alto - 190) + 'px'; // altoPagina - piePagina - altoFoto - diff(posOriginal y topPagina)
		//alert($player.style.top)
	} else {
		//$player.style.top = $ancho < 200 ? eval($posicion + 30) + 'px' : $posicion + 'px'; // Si es horizontal le sumo 30px
		$player.style.top = eval($posicion + 30) + 'px';
	}
}
function ES_cierraFoto() { // By E-S
	$player = document.getElementById('contFoto');
	$player.className = "";	
}


