
$(document).ready(function () {
	$(".imgth a").each( function (i) {
		$(this).attr("href","#").click(function () {
			addr1=$("img",this).attr("src");
			$("#divFoto a").attr({"href":"#"}).html('<img src="'+addr1.replace(/t\.jpg/,'.jpg')+'" />').click(function () {
				$("#divFoto").css("left","-300%");
				return false;
			});

			$("#divFoto a img").load(function () {
				newwidth=$(this).width()>900?900:$(this).width();
				$(this).css('width',newwidth+'px');
				lef=(parseInt($(window).width()/2)-parseInt($(this).width()/2))+"px";
				topp=((parseInt($(window).height()/2)-parseInt($(this).height()/2))+$("body").scrollTop())+"px";
				$("#divFoto").css({"left":lef,"top":topp});
			});

			
			return false;
		});

	});
	$(".bkgPage").width(753-(parseInt($(".bkgPage").width())-753));
});


