(function($) { $(document).ready(function() {

	//console.log($('div#menu-trigger-level1'));

	/* accordéon pour des views pane */
	$('div.accordion-h2.accordion-h2-views div.view-header').click(function() {
		$(this).siblings('div.view-content').toggle('fast', function() {
			$(this).parent().parent().parent().toggleClass('accordion-h2-opened');
		});
	});

	/* accordéon pour des panels pane */
	$('div.accordion-h2.accordion-h2-panel > h2.pane-title').click(function() {
		$(this).siblings('div.pane-content').toggle('fast', function() {
			$(this).parent().toggleClass('accordion-h2-opened');
		});
	});

	/* accordéon auto-exclusifs pour des panels pane */
	$('div.accordion-h2-ex.accordion-h2-panel > h2.pane-title').click(function() {
		$(this).parent().siblings('div.accordion-h2-ex').children('div.pane-content').hide();
		$(this).parent().siblings('div.accordion-h2-ex').removeClass('accordion-h2-opened');
		$(this).siblings('div.pane-content').toggle('fast', function() {
			$(this).parent().toggleClass('accordion-h2-opened');
		});
	});


	/* accordéon pour des panels pane */
	$('div.accordion-trigger').click(function() {
		$(this).toggleClass('accordion-h2-opened');
		$(this).parent().parent().siblings('div.accordion-content').toggle('fast', function() {

		});
		$(this).siblings('div.accordion-content').toggle('fast', function() {

		});
	});




	$('div#menu-trigger-level1').click(function() {

		$('#block-menu_block-3').slideDown('slow', function() {
			// Animation complete.
		});
		$('div#menu-trigger-level1').hide();
		$('div#menu-trigger-level1-off').show();
	});

	$('div#menu-trigger-level1-off').click(function() {

		$('#block-menu_block-3').slideUp('slow', function() {
			// Animation complete.
		});
		$('div#menu-trigger-level1-off').hide();
		$('div#menu-trigger-level1').show();
	});



	$('.flexslider').flexslider({
  	/*selector: 'ul > li',*/
    animation: "fade",
    animationLoop: true,
    itemWidth: "100%",
    /*itemMargin: 0,
    minItems: 1,*/
    controlNav: false,               //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
		directionNav: false,             //Boolean: Create navigation for previous/next navigation? (true/false)
		prevText: "Précédent",           //String: Set the text for the "previous" directionNav item
		nextText: "Suivant",

    /*maxItems: 10,*/
    /*start: function(slider){
      $('body').removeClass('loading');
    }*/
  });




	/* AMSTERDAM */
	$("#point-nid-870").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});

	/* BARCELONE */
	$("#point-nid-871").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});
	/* BERLIN */
	$("#point-nid-872").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});
	/* BIRMINGHAM */
	$("#point-nid-873").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});
	/* BORDEAUX */
	$("#point-nid-869").popover({
		title: false,
		trigger: "hover",
		content: "<ul><li class='popsu1'><a href='/popsu1/bordeaux/presentation'>POPSU France 1</a></li>" +
				"<li class='popsu2'><a href='/popsu2/bordeaux/presentation-0'>POPSU France 2</a></li>" +
				"</ul>"
	});
	/* BRUXELLES */
	$("#point-nid-874").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});

	/* Copenhague */
	$("#point-nid-875").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});
	/* dordrecht */
	$("#point-nid-961").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});

	/* dunkerque */
	$("#point-nid-962").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});

	/* GRENOBLE */
	$("#point-nid-876").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsu2'><a href='/popsu2/grenoble/presentation-0'>POPSU France 2</a></li>" +
				"</ul>"
	});
	/* Hambourg */
	$("#point-nid-963").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});
	/* LAUSANNE */
	$("#point-nid-877").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});
	/* LILLE */
	$("#point-nid-878").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsu1'><a href='/popsu1/lille/presentation'>POPSU France 1</a></li>" +
				"<li class='popsu2'><a href='/popsu2/lille/presentation-0'>POPSU France 2</a></li>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});
	/* LONDRES */
	$("#point-nid-879").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});
	/* LYON */
	$("#point-nid-880").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsu1'><a href='/popsu1/lyon/presentation'>POPSU France 1</a></li>" +
				"<li class='popsu2'><a href='/popsu2/lyon/presentation-0'>POPSU France 2</a></li>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});
	/* MALAGA */
	$("#point-nid-881").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});
	/* MARSEILLE */
	$("#point-nid-882").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsu1'><a href='/popsu1/marseille/presentation'>POPSU France 1</a></li>" +
				"<li class='popsu2'><a href='/popsu2/marseille/presentation-0'>POPSU France 2</a></li>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});

	/* mayence */
	$("#point-nid-964").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});
	/* Montpellier */
	$("#point-nid-883").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsu1'><a href='/popsu1/montpellier/presentation'>POPSU France 1</a></li>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});


	/* Montréal */
	$("#point-nid-884").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});


	/* Nantes */
	$("#point-nid-868").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsu1'><a href='/popsu1/nantes/presentation'>POPSU France 1</a></li>" +
				"<li class='popsu2'><a href='/popsu2/nantes/presentation-0'>POPSU France 2</a></li>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});

	/* Nimes */
	$("#point-nid-965").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});


	/* Paris */
	$("#point-nid-885").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});


	/* Rennes */
	$("#point-nid-886").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsu2'><a href='/popsu2/rennes/presentation-0'>POPSU France 2</a></li>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});


	/* Rotterdam */
	$("#point-nid-887").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});


	/* Strasbourg */
	$("#point-nid-888").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsu2'><a href='/popsu2/strasbourg/presentation-0'>POPSU France 2</a></li>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});

	/* Stuttgart */
	$("#point-nid-1031").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});


	/* Rome */
	$("#point-nid-1030").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});


	/* Toulon */
	$("#point-nid-889").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsu2'><a href='/popsu2/toulon/presentation-0'>POPSU France 2</a></li>" +
				"</ul>"
	});


	/* Toulouse */
	$("#point-nid-890").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsu1'><a href='/popsu1/toulouse/presentation'>POPSU France 1</a></li>" +
				"<li class='popsu2'><a href='/popsu2/toulouse/presentation-0'>POPSU France 2</a></li>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});


	/* Turin */
	$("#point-nid-891").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});


	/* Vienne */
	$("#point-nid-892").popover({
		title: false,
		trigger: "hover",
		content: "<ul>" +
				"<li class='popsueurope'><a href='/popsu-europe/accueil'>POPSU Europe</a></li>" +
				"</ul>"
	});



	$.each($(".captioned img"), function(legend, item) {
		title = $(item).attr('title')
		if (title && title != "") {
			$(item).after('<p class="flex-caption"><span class="ville-title">' + title + '</span></p>');
		}
	});





}); })(jQuery);





















