  var curr=1;
	     var curr_visible=1;
		 var count_visible=5;
		 var sdelay=2000;
		 /*
		 var deltaX=new Array("400","300","200","100","0");
		 var deltaY=new Array("50","25","0","25","50");
		 */
		 var deltaX=new Array("400","200","350","300","250");
		 var deltaY=new Array("70","20","15","35","75");
		 var count_imgs;//=jQuery("#carusel2 img").length;
		// alert(count_imgs)
		 var z_index=10;
		 var super_z=z_index+count_visible+1;

	    function load_div(){//alert("dsf")
		jQuery('#carusel_main img').hide();
		jQuery('#carusel_main').show();
	 	}
	 	
		function next_play(){
		
		tops=deltaY[curr_visible-1]+"px";
		lefts=deltaX[curr_visible-1]+"px";
		pref="#carusel2 img:nth-child("+curr+")";
		//alert(pref);
		src=jQuery(pref).attr('src');
		jQuery("#carusel_main").append("<img src='"+src+"'/>");
		jQuery('#carusel_main img').mouseover(function(){ super_z++;jQuery(this).css("z-index",super_z);})
		jQuery('#carusel_main img').mouseleave(function(){jQuery(this).css("z-index",z_index);})
		jQuery('#carusel_main img').click(function(){location.href="http://mlosinka.ru/losinka/foto_albomy/den_goroda/";})
		
		pref="#carusel_main img:last(0)";
		jQuery(pref).css('left',lefts)
				.css('top',tops).hide().css("z-index",z_index)
				.delay(sdelay*(1)).fadeIn('slow');
		pref="#carusel_main img";
		var len=jQuery(pref).length;
		
		if (len>count_visible ){
		//alert (len+ " "+count_visible+" "+curr+" "+count_imgs)
		   jQuery('#carusel_main img:first(0)').delay(sdelay*(1)).fadeOut('slow',function(){jQuery('#carusel_main img:first(0)').remove()});	     }
		 if (count_imgs>curr){
				curr++; //alert(curr)
			  }else{curr=1;}
			  if (count_visible>curr_visible){
					curr_visible++;
				}else{curr_visible=1;}
			  setTimeout(next_play,sdelay*2);
	}

