		var carousel_telement = 0; 
		var carousel_width=137;
		var carousel_animate_speed=500;
		var carousel_pointHeight=19;
		var carousel_npWidth=23;
		var carousel_points=false;		

		function move(side){
			if (side=='right'){
				if(carousel_width*(carousel_countSlides-1-carousel_telement)<carousel_allwidth) $('#next').css({'background-position':'-'+carousel_npWidth+'px 0px','cursor':'default'});
				else $('#next').css({'background-position':'0px 0px','cursor':'pointer'});
				if(carousel_telement!=0)$('#prev').css({'background-position':'0px 0px','cursor':'pointer'});
				$('.currItem').css({'background-position':'0px 0px','cursor':'pointer'});
				if(carousel_points)$('#c_'+carousel_telement).css({'background-position':'0px -'+carousel_pointHeight+'px','cursor':'default'});
				$('#animatedBlocksContainer').animate({'left':0-carousel_width*carousel_telement+'px'},carousel_animate_speed);			
			}

			if (side=='left'){
				if (carousel_telement ==0) $('#prev').css({'background-position':'-'+carousel_npWidth+'px 0px','cursor':'default'});
				else $('#prev').css({'background-position':'0px 0px','cursor':'pointer'});
				if(carousel_width*(carousel_countSlides-1-carousel_telement)<=carousel_allwidth)$('#next').css({'background-position':'0px 0px','cursor':'pointer'});
				$('.currItem').css({'background-position':'0px 0px','cursor':'pointer'});
				if(carousel_points)$('#c_'+telement).css({'background-position':'0px -'+carousel_pointHeight+'px','cursor':'default'});
				$('#animatedBlocksContainer').animate({'left':0-carousel_width*carousel_telement+'px'},carousel_animate_speed);					
			}
		}
		$(document).ready(function(){
			$('.currItem').css({'background-position':'0px 0px','cursor':'pointer'});
			if(carousel_points)$('#c_'+carousel_telement).css({'background-position':'0px -'+carousel_pointHeight+'px','cursor':'default'});
			$('#prev').css({'background-position':'-'+carousel_npWidth+'px 0px','cursor':'default'});
			$('#next').css({'background-position':'0px 0px','cursor':'pointer'});
			if((carousel_width*(carousel_countSlides-1-carousel_telement)<carousel_allwidth))$('#next').css({'background-position':'-'+carousel_npWidth+'px 0px','cursor':'pointer'});
			$('#animatedBlocksContainer').css('width', 0+carousel_width*carousel_countSlides+'px');
			$('#animatedBlocksContainer>div.itemBlocks').each(function(){
				nmb = $(this).attr('num');
				$(this).css('left', carousel_width*nmb+'px');
				
			});
			$('#currentBlock>div.currItem').each(function(){
				tmp = $(this).attr('curr');
				$(this).css('left', 28*tmp+'px');
			});

		
		$('#next').click(function (){
			if(!(carousel_width*(carousel_countSlides-1-carousel_telement)<carousel_allwidth)){
				carousel_telement++;
				move('right');
			}
		});
		$('#prev').click(function (){
			if(carousel_telement != 0){
				carousel_telement--;
				move('left');
			}
		});	

		$('.currItem').click(function(){
			tmp = $(this).attr('curr');
			if (carousel_telement<tmp){
				carousel_telement = tmp;
				move('right');
			}
			if (carousel_telement>tmp){
				carousel_telement = tmp;
				move('left');
			}
			
		});
		
		$(".itemBlocks").mouseover(function(){
			$(this).addClass($(this).attr("oclass")+"_hover");
			$.each($(this).children(),function(i, val){
				 if($(this).attr("oclass"))$(this).addClass($(this).attr("oclass")+"_hover");
			});			
		});
		$(".itemBlocks").mouseout(function(){
			$(this).removeClass($(this).attr("oclass")+"_hover");
			$.each($(this).children(),function(i, val){
				if($(this).attr("oclass"))$(this).removeClass($(this).attr("oclass")+"_hover");
			});		
		});		
		});
