$(document).ready(function() {

	$("#topnav li").prepend("<span></span>");

	$("#topnav li").each(function() {
		var linkText = $(this).find("a").html();
		$(this).find("span").show().html(linkText);
	}); 

	$("#topnav li").hover(function() {
		$(this).find("span").stop().animate({
			marginTop: "-40"
		}, 370);
	} , function() {
		$(this).find("span").stop().animate({
			marginTop: "0"
		}, 370);
	});

	Cufon.replace('h1, h2, h3, h4, .cijena_detalji, .tagline');
	Cufon.replace('.cat_menu li', {color: '#ffffff',
				  hover: {color: '#ffffff'}
				  });

	$('#slideshow').cycle({ 
		fx:     'scrollHorz', 
		speed:  'slow',
		timeout: 3500,
		next:   '#next', 
		prev:   '#prev' 
	});
	$('#slider').hide();

$(window).load(function() {
	$('#slider').show();
	$('#slider').nivoSlider({
		effect:'fold',
		slices:15,
		animSpeed:600,
		pauseTime:3500,
		directionNav:true, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:true, //1,2,3...
		keyboardNav:true, //Use left & right arrows
		pauseOnHover:true, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.5, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides have been shown
	});
});

});


