 $(document).ready(function(){
 // cycle
 $('.cycle').cycle({
		fx: 'fade',
		timeout: 1000
	});

// marquee
$('.marquee').marquee();
	
// superbox gallery
$(function(){
	$.superbox.settings = {
		overlayOpacity: .8,
		closeTxt: "Затвори",
		loadTxt: "Почекај..."
	};
	$.superbox();
});

 
// clear input value on focus
$('.searchBox input').each(function() {
	var default_value = this.value;
	$(this).focus(function() {
		if(this.value == default_value) {
			this.value = '';
		}
	});
	$(this).blur(function() {
		if(this.value == '') {
			this.value = default_value;
		}
	});
});
 
 
 // slider
 var moveNr = 125; /* 105 width + 20 padding */
 var pageItems = 5;
 var items = $(".proektiContainer ul li").size();
 var fullsize = moveNr*items;

 
$(".proektiContainer").css("width",fullsize+"px");
 
 $("#strelkaDesno").click(function(){
	margin = $(".proektiContainer").css("margin-left");
	items = $(".proektiContainer ul li").size();
	full = ((items*parseInt(moveNr))*(-1))+(pageItems*moveNr);
	
	arr = margin.split("px");
	 //alert(arr[0]);
	 // alert(full);
	
	if (arr[0]>=(full+parseInt(moveNr))){
		move = parseInt(arr[0])-parseInt(moveNr);
		$(".proektiContainer").animate({ 
			marginLeft: move+"px"
		  }, 200);
	}
		
 });
  $("#strelkaLevo").click(function(){
	margin = $(".proektiContainer").css("margin-left");
	arr = margin.split("px");

	if (arr[0]<0){
		move = parseInt(arr[0])+parseInt(moveNr);
		$(".proektiContainer").animate({
			marginLeft: move+"px"
		}, 200);
	}
 });
 
 


});


