// Preload images
Image1= new Image(620,360)
	Image1.src = "../images/1.jpg"
Image2 = new Image(620,360)
	Image2.src = "../images/2.jpg"
Image3 = new Image(620,360)
	Image3.src = "../images/3.jpg"
Image4 = new Image(620,360)
	Image4.src = "../images/4.jpg"
Image5 = new Image(2100,332)
	Image4.src = "../images/c-for.png"


// Nivo Slider
$(window).load(function() {
	$('#slider').nivoSlider({
		effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
		slices: 15,
		animSpeed: 300, //Slide transition speed
		pauseTime: 7000,
		startSlide: 0, //Set starting Slide (0 index)
		directionNav: false, //Next & Prev
		directionNavHide: true, //Only show on hover
		controlNav: false, //1,2,3...
		controlNavThumbs: false, //Use thumbnails for Control Nav
		controlNavThumbsFromRel: false, //Use image rel for thumbs
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav: true, //Use left & right arrows
		pauseOnHover: false, //Stop animation while hovering
		manualAdvance: false, //Force manual transitions
		captionOpacity: 0.8, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides have been shown
	});
});
	
// Fade navigation
$(document).ready(function() {
	$('ul.nav li a').hover(function() {
		$(this).stop().animate({backgroundColor: '#aa0c31'});
		}, function() {
			$(this).stop().animate({backgroundColor: '#f9f9f9'});
	});
	$('ul.nav li a.current').hover(function() {
		$(this).stop().animate({backgroundColor: '#aa0c31'});
  });

	$('ul.subnav li a').hover(function() {
    	$(this).stop().animate({backgroundColor: '#f7e7eb'});
		}, function() {
			$(this).stop().animate({backgroundColor: '#fff'});
	});
	$('ul.subnav li a.current').hover(function() {
		$(this).stop().animate({backgroundColor: '#f7e7eb'});
	});
});

// Masonry
$(window).load(function() {
	$('.content').masonry({
		singleMode: true, 
		itemSelector: '.newslist' 
	});
});

// Captions
$(document).ready(function() {
	$('.pictures img').hover_caption({
		caption_font_size: '14px',
		caption_color: '#aa0c31',
		caption_bold: true,
		caption_default: "SPAZIO"
	});
});

