jQuery(document).ready(function(){

		/*jQuery(".content a img.zoom").parent("a").click(
				function(){
				return hs.expand(this);
				return false;
				}
		);*/

		jQuery(".block_foto_item a img").parent("a").click(
				function(){
				$(".pic_show").empty();
				$(".pic_show").append('<a class="zooma" href="'+$(this).attr("href")+'"><img width="400" class="zoom" src="'+$(this).attr("href")+'"></a>');
				$('#title').html('<h3>'+$(this).attr("title")+'</h3>');
				//return hs.expand(this);
				return false;
				}
		);

		$(".pic_show a").livequery('click', function(event) {
        return hs.expand(this);
		//alert("123");
		return false;
   		});



		jQuery("#printpic").click(
				function(){
				var my=window.open($(".zooma").attr("href"));
				my.print();
				return false;
				}
		);

		jQuery("#copypic").click(
				function(){
				var my1=window.clipboardData.setData('Text', "http://"+document.domain+$(".zooma").attr("href"));
				return false;
				}
		);

		var contimg=0;
		if($("#block_foto1").find("div").length>4)
			{$("#c_left").show(); $("#r_left").show();}
		var contimg_present=Math.ceil((($("#block_foto1").find("div").length/4)-1));
		$(".position").append("1-4");
		var position=4;
		var countfoto=$("#block_foto1").find("div").length;
		if(countfoto>4) {$("#c_left").show(); $("#r_left").show();}
		$(".countfoto").append($("#block_foto1").find("div").length);
	jQuery("#c_left").click(
		function(){
		mar=$("#block_foto1").css("margin-left").replace("px", "");
		mar=parseInt(mar);
		if (contimg>0) {
		contimg--;
		mar=mar+535;
		mar=mar+"px";
		$("#c_left").hide();
		position1=position-4;
		if(position1==0) {position1=1;}
		if(position1<0) {position1=1;}
		if(position1==4) {position1=1;}
		position=position-4;
		$(".position").empty();
		$(".position").append(position1+"-"+position);

		$("#block_foto1").animate({"margin-left": mar}, 535, "linear",function(){$("#c_left").show();});
		}
		return false;
		});

	jQuery("#r_left").click(
		function(){

		mar=$("#block_foto1").css("margin-left").replace("px", "");
		mar=parseInt(mar);
		if (contimg<contimg_present) {
		contimg++;
		mar=contimg*(-535);
		mar=mar+"px";
		$("#r_left").hide();
		position1=position+1;
		position=position+4;
		if(position>countfoto)
		{
		position2=position;
		position=countfoto;
		$(".position").empty();
		$(".position").append(position1+"-"+position);
		position=position2;
		}
		else
		{
		$(".position").empty();
		$(".position").append(position1+"-"+position);
		}

		$("#block_foto1").animate({"margin-left": mar}, 535, "linear",function(){$("#r_left").show();});
		}
		return false;
		});


});

