$(document).ready(function() {
	$("#obra1,#obra2,#obra3,#obra4").mouseover(function() {
		if (navigator.appName != "Microsoft Internet Explorer")
			$(this).css("opacity","1");
		else
			$(this).css("filter","alpha(opacity=100)");
		$("#"+this.id+"pie").show();
	});
	$("#obra1,#obra2,#obra3,#obra4").mouseout(function() {
		if (navigator.appName != "Microsoft Internet Explorer")
			$(this).css("opacity","0.6");
		else
			$(this).css("filter","alpha(opacity=60)");
		$("#"+this.id+"pie").hide();
	});
	$("#obra1").click(function() {
		$("#contenido").fadeOut(500, function() {
			ajax = nuevoAjax();
			ajax.open("GET","ficha.php?id=1",true);
			ajax.onreadystatechange = function() {
				if (ajax.readyState == 4) {
					$("#contenido").html(ajax.responseText);
				}
			}
			ajax.send(null);
			$("#contenido").css("text-align","center");
			$("#contenido").css("border","1px solid #c9c9c9");
			$("#contenido").css("overflow","hidden");
			$("#contenido").fadeIn(500);
		});
	});
	$("#obra2").click(function() {
		$("#contenido").fadeOut(500, function() {
			ajax = nuevoAjax();
			ajax.open("GET","ficha.php?id=2",true);
			ajax.onreadystatechange = function() {
				if (ajax.readyState == 4) {
					$("#contenido").html(ajax.responseText);
				}
			}
			ajax.send(null);
			$("#contenido").css("text-align","center");
			$("#contenido").css("border","1px solid #c9c9c9");
			$("#contenido").css("overflow","hidden");
			$("#contenido").fadeIn(500);
		});
	});
	$("#obra3").click(function() {
		$("#contenido").fadeOut(500, function() {
			ajax = nuevoAjax();
			ajax.open("GET","ficha.php?id=3",true);
			ajax.onreadystatechange = function() {
				if (ajax.readyState == 4) {
					$("#contenido").html(ajax.responseText);
				}
			}
			ajax.send(null);
			$("#contenido").css("text-align","center");
			$("#contenido").css("border","1px solid #c9c9c9");
			$("#contenido").css("overflow","hidden");
			$("#contenido").fadeIn(500);
		});
	});
	$("#obra4").click(function() {
		$("#contenido").fadeOut(500, function() {
			ajax = nuevoAjax();
			ajax.open("GET","ficha.php?id=4",true);
			ajax.onreadystatechange = function() {
				if (ajax.readyState == 4) {
					$("#contenido").html(ajax.responseText);
				}
			}
			ajax.send(null);
			$("#contenido").css("text-align","center");
			$("#contenido").css("border","1px solid #c9c9c9");
			$("#contenido").css("overflow","hidden");
			$("#contenido").fadeIn(500);
		});
	});
});

