jQuery(window).load(function(){
	var poz = $(".ph_zm");
	var posit = poz.offset();
	var wdt = poz.width() / 2;
	var hdt = poz.height() - 51;
	poz.css({'margin-left' : '-' + wdt + 'px'});
	$(".ph_zm .lgr").height(hdt);
	$(".ph_zm .rgr").height(hdt);
	var hgt;
	var wgt;
	hgt = $(".ph_zoom img:visible").height();
	wgt = $(".ph_zoom img:visible").width();
	$(".ph_zm .tgr").width(wgt+26);
	$(".ph_zm .bgr").width(wgt+26);
	$(".ph_zm .skn").width(wgt+26);
	posit = poz.offset();
	poz.hide();


	$(".prof_photo .small img:visible").click(function(){
		poz.hide();
		var offim = $(this).offset();
		$(this).clone()
		.insertAfter(this)
		.css({'z-index' : '6', 'position' : 'absolute', 'top' : offim.top + 'px', 'left' : offim.left + 'px'})
		.fadeTo("fast", 0)
		.animate({opacity: "1", top: "53", left: posit.left+13, height: hgt, width: wgt}, "fast", "swing", function()
		{
			poz.css({'visibility' : 'visible'});
			poz.show();
			$(this).remove();
		});
	});
       $(".prof_photo .big img:visible").click(function(){
		poz.hide();
		var offim = $(this).offset();
		$(this).clone()
		.insertAfter(this)
		.css({'z-index' : '6', 'position' : 'absolute', 'top' : offim.top + 'px', 'left' : offim.left + 'px'})
		.fadeTo("fast", 0)
		.animate({opacity: "1", top: "53", left: posit.left+13, height: hgt, width: wgt}, "fast", "swing", function()
		{
			poz.css({'visibility' : 'visible'});
			poz.show();
			$(this).remove();
		});
	});

	poz.click(function(){
		$(this).hide();
		var offim = $(".prof_photo .big img:visible").offset();
		$(".prof_photo .big img:visible").clone()
		.insertAfter(this)
		.css({'z-index' : '6', 'position' : 'absolute', 'top' : '53px', 'left' : posit.left+13 + 'px', 'width' : wgt + 'px', 'height' : hgt + 'px'})
		.fadeTo("fast", 0)
		.animate({opacity: "1", top: offim.top, left: offim.left, height: 148, width: 213}, "fast", "swing", function()
		{
			$(this).remove();
		});
	});
});
