var ddt=1;


$(document).ready(function() {
	$('#content').append('<p>appblock</p>');
	$(".cat").animate({opacity:'0.6'},1);
	$("#zap-wige").find("a.prtnr").attr('role','blank');
	var imageWidth = $("#zap-wiget").width();
	var imageSum = $(".slider  .blcd").size();
	var imageReelWidth = (imageWidth * imageSum);
	$(".slider").css({'width' : imageReelWidth});
	var activeimg=0;
	
	rotate=function(dr){
		
		if(dr==1){
			if(activeimg==(imageSum-1)) activeimg=0; else activeimg++; 
		} else {
			if(activeimg>=1) activeimg--; else activeimg=imageSum-1;
		}
		image_reelPosition=-imageWidth*activeimg;		
		$(".slider").animate({ 
			left: image_reelPosition
		}, 700 );
	}
	
	rotateSwitch = function(){		
		play = setInterval(function(){
			rotate(1);
		}, 8000);
	};

	rotateSwitch();
	
	$("#zap-wiget a").hover(function() {
		clearInterval(play);
	}, function() {
		rotateSwitch();
	});


	$("#zap-wiget > a.next").click(
		function(){
			rotate(1);
		}
	);
	$("#zap-wiget > a.prev").click(
		function(){
			rotate(0);
		}
	);

});
