$(document).ready(function(){
	/*Menu de gauche*/
	jQuery("#accordion").accordion({
		navigation: true,
		animated: 'easeslide',
		active: false,
		collapsible: true,
		header: 'a.header',
		autoHeight: false
	});
		
	/*Top menu*/
	jQuery("#navigation").menuDeroulant();
	
	/*Projets en liste*/
	jQuery("#liste_projets").orsaProjets();
	
	
	
	/*Diaporama mediatheque*/
	jQuery.noConflict();
	jQuery('.diaporama').diaporama();
	
	/*6 blocs de la Home*/
	jQuery("#bloc_actus_home").orsaTabs();
	
	/*rollover actus*/
	jQuery('.actu_liste a').hover(
			function(){
				jQuery(this).siblings('a').andSelf().css('text-decoration', 'underline');
			},
			function(){
				jQuery(this).siblings('a').andSelf().css('text-decoration', 'none');
			}
	);
	
	//heuteur du menu alignée sur celle du contenu
	var padding = jQuery('#gauche').outerHeight() - jQuery('#gauche').height();
	jQuery('#gauche').height(jQuery('#centre').outerHeight()-padding);
	
	//actions sur les liens colonne de droite
	var colorBoxDefaults = {
		initialWidth: 300,
		initialHeight: 200,
		current: "<!--image {current} / {total}-->",
		previous: "Image suivante",
		next: "Image précédente",
		close: "Fermer",
		slideshowStart: "Lancer le diaporama",
		slideshowStop: "Arrêter le diaporama",
		onComplete: function(){
			jQuery("#cboxTitle").text(jQuery('#cboxLoadedContent #chapeau_media').text());
		}
	};
	
	var lbProj = jQuery(".lightboxes_projet a[rel='image_js']");
	lbProj.colorbox(jQuery.extend({}, colorBoxDefaults, {
		boxClass: 'projet'
	}));
	
	jQuery("a[rel='image_js']").not(lbProj).colorbox(colorBoxDefaults);
	
	var lbDiapos; 
	jQuery("a[rel='diaporama_js']").colorbox(jQuery.extend({}, colorBoxDefaults, {
		onComplete: function(){
			colorBoxDefaults.onComplete();
			lbDiapos = jQuery('#cboxLoadedContent .diaporama').diaporama();
			jQuery.colorbox.resize();
		},
		onClosed: function(){
			lbDiapos.stopDiaporama();
		}
	}));
	
	
	jQuery(".video_js").colorbox(colorBoxDefaults);
	
	jQuery("._bleu .project_sheet").colorbox(jQuery.extend({}, colorBoxDefaults, {
		width:"50%", 
		boxClass: 'projet'
	}));
	
	jQuery("._vert .project_sheet").colorbox(jQuery.extend({}, colorBoxDefaults, {
		width:"50%", 
		boxClass: 'projet vert'
	}));
	
	jQuery("._rouge .project_sheet").colorbox(jQuery.extend({}, colorBoxDefaults, {
		width:"50%", 
		boxClass: 'projet rouge'
	}));
	
	jQuery("a[rel='iconique_js']").colorbox(colorBoxDefaults);
});
