scrollCachePosition = 0;

function popupCssShow (URL, width, height) {



	if (typeof document.body.style.maxHeight === "undefined") {//if IE 6

		$("body","html").css({height: "100%", width: "100%"});

		//$("html").css("overflow","hidden");

	}

	if (!$("#cssBackground").length>0) {	

		$("body").append("<div id=\"cssBackground\"></div><div id=\"cssPopupContainer\"><div id=\"cssPopup\"></div></div>");

	}

	if (width!=undefined) {

		$("#cssPopup").css("width",width);

	}

	if (height!=undefined) {

		$("#cssPopup").css("height",height);

		$("#cssPopup").css("overflow","auto");

	}

	$("#cssBackground").slideDown("slow");

	//$("#cssPopup").css("background-color","#ececec");

	scrollCachePosition = $(window).scrollTop();

	window.top.scroll(0,0);

	

	$("#cssPopup").load(URL,function(){

		//$("#cssPopupContainer").center();
		

		$("#cssPopupContainer").css("top",50);

		ancho=$(window).width();

		$("#cssPopupContainer").slideDown("fast", function () {

			anchopopup=$("#cssPopup").width();

			$("#cssPopupContainer").css("width",ancho);			

		});

	});

}



function popupCssHide () {

	$("#cssPopupContainer").slideUp("fast", function () {

		$("#cssBackground").fadeOut("fast",function () {

			$("#cssBackground").remove();

			$("#cssPopupContainer").remove();

		});

	});

	if (scrollCachePosition > 0) {

		window.top.scroll(0,scrollCachePosition);

		//Reseteamos la variable scrollCachePosition a 0 para poder ejecutar el script tantas veces sea necesario.

		scrollCachePosition = 0;

	}

	if (document.getElementById("keaVideoYT")) {	

		displayCapa('keaVideoYT','block');	

	}

}




