$(document).ready(function() {
	$('#drop_mercati').addClass('active');
	$('#mercati').fadeIn(500);
	$('#mercati .pane').jScrollPane( {
				showArrows : true
		});

	$('.holder p').show();

	$('#recent').fadeIn(1000);
	$(".nav, .head").localScroll( {
		target : ".scroll_part",
		queue : true,
		axis: 'x',
		duration : 0

	});
	$(".drop_up").localScroll( {
		target : ".footer_scroll",
		queue : true,
		duration : 0,
		axis: 'x'
	});


	$('.logo').click(function() {
		$('#recent').fadeIn(1000);
		//$('#macro, #nature,#people,#animals').fadeOut('fast');
	});

	$('#recent a.zoom').click(function(){
		$('#recent a.zoom').removeClass('tyk');
		$(this).addClass('tyk');
	});

	$('.nav a').click(function() {
		$('.nav a').removeClass('current');
		$(this).addClass('current');
	});
	$('.logo').click(function() {
		$('.nav a').removeClass('current');
		$('#nav_recent').addClass('current');
	});

	$('#drop_mercati').click(function() {
		$('.drop_nav li').removeClass('active');
		$('#drop_mercati').addClass('active');
			$('#mercati').fadeIn(500);
			$('#mercati .pane').jScrollPane( {
				showArrows : true
			});
			$('.holder p').hide();
			$('.holder p').show();
			$('#esperienze').fadeOut(50);
			$('#dove').fadeOut(50);
			$('#partners').fadeOut(50);
			$('#news').fadeOut(50);


	});

	$('#drop_esperienze').click(function() {
		$('.drop_nav li').removeClass('active');
		$('#drop_esperienze').addClass('active');

			$('#esperienze').fadeIn(500);
				$('#esperienze .pane').jScrollPane({
					showArrows : true
				});
			$('#mercati').hide();
			$('#dove').hide();
			$('#partners').hide();
			$('#news').hide();

	});
	$('#drop_dove').click(function() {
		$('.drop_nav li').removeClass('active');
		$('#drop_dove').addClass('active');


			$('#dove').fadeIn(500);

			$('#mercati').hide();
			$('#esperienze').hide();
			$('#partners').hide();
			$('#news').hide();



	});
	$('#drop_partners').click(function() {
		$('.drop_nav li').removeClass('active');
		$('#drop_partners').addClass('active');

			$('#partners').fadeIn(500);
			$('#partners .pane').jScrollPane({
								showArrows : true
							});
			$('#mercati').hide();
			$('#esperienze').hide();
			$('#dove').hide();
			$('#news').hide();



	});
	$('#drop_news').click(function() {
		$('.drop_nav li').removeClass('active');
		$('#drop_news').addClass('active');

			$('#news').fadeIn(500);
		$('#news .pane').jScrollPane( {
						showArrows : true
					});
			$('#mercati').hide();
			$('#esperienze').hide();
			$('#dove').hide();
			$('#partners').hide();




	});


	/*$('#hide').click(function(){
		$('#claim').animate({opacity:1},1000);
		$('.drop_up').animate({'top':'578px'}, 1000);
		$('.drop_nav li').removeClass('active');
		$('#mercati').hide()
		$('#esperienze').hide()
		$('#dove').hide()
		$('#partners').hide()
		$('#news').hide()
		$('#hide').hide()
	});*/

	$("a[rel=example_group]").fancybox({
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'width':800,
		'titlePosition':'inside',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">'+ (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});

	$("a[rel=example_group2]").fancybox({
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'titlePosition':'inside',
			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">'+ (title.length ? ' &nbsp; ' + title : '') + '</span>';
			}
		});
	$("a[rel=example_group3]").fancybox({
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'titlePosition':'inside',
			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">'+ (title.length ? ' &nbsp; ' + title : '') + '</span>';
			}
		});
	$("a[rel=example_group4]").fancybox({
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'titlePosition':'inside',
			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">'+ (title.length ? ' &nbsp; ' + title : '') + '</span>';
			}
		});
	$("a[rel=example_group5]").fancybox({
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'titlePosition':'inside',
			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">'+ (title.length ? ' &nbsp; ' + title : '') + '</span>';
			}
		});
	$("a[rel=example_group6]").fancybox({
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'titlePosition':'inside',
			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">'+ (title.length ? ' &nbsp; ' + title : '') + '</span>';
			}
		});
	$("a[rel=example_group7]").fancybox({
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'titlePosition':'inside',
			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">'+ (title.length ? ' &nbsp; ' + title : '') + '</span>';
			}
		});
	$("a[rel=example_group8]").fancybox({
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'titlePosition':'inside',
			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">'+ (title.length ? ' &nbsp; ' + title : '') + '</span>';
			}
		});
	$("a[rel=example_group9]").fancybox({
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'titlePosition':'inside',
			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">'+ (title.length ? ' &nbsp; ' + title : '') + '</span>';
			}
		});
	$("a[rel=example_group10]").fancybox({
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'titlePosition':'inside',
			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">'+ (title.length ? ' &nbsp; ' + title : '') + '</span>';
			}
		});




});



