$(document).ready(function() {


	$('.modal_reglement').click(function(e) {
		e.preventDefault();
		parent.$.nyroModalManual({
			url: '/reglement.php#modalContent'
		});
	});

	$('.modal_cgv').click(function(e) {
		e.preventDefault();
		parent.$.nyroModalManual({
			url: '/cgv.php#modalContent'
		});
	});


	$('.modal_connect').click(function(e) {
		e.preventDefault();
		$('#modal_msg_txt').html('Vous devez être connecté pour accéder à cette rubrique.<br /><br /><a href="inscription.php">Comment m\'inscrire ?</a><br /><a href="code-perdu.php">Comment retrouver mes identifiants ?</a>');
		parent.$.nyroModalManual({
			url: '#modal_msg'
		});
	});


	$('.modal_dev').click(function(e) {
		e.preventDefault();
		$('#modal_msg_txt').html('Cet accès est en cours de développement...');
		parent.$.nyroModalManual({
			url: '#modal_msg'
		});
	});



	$.nyroModalSettings({
		debug: false, // Show the debug in the background
		blocker: false, // Element which will be blocked by the modal
		windowResize: true, // indicates if the modal should resize when the window is resized
		modal: false, // Esc key or click backgrdound enabling or not
		type: '', // nyroModal type (form, formData, iframe, image, etc...)
		forceType: null, // Used to force the type
		from: '', // Dom object where the call come from
		hash: '', // Eventual hash in the url
		processHandler: null, // Handler just before the real process
		selIndicator: 'nyroModalSel', // Value added when a form or Ajax is sent with a filter content
		formIndicator: 'nyroModal', // Value added when a form is sent
		content: null, // Raw content if type content is used
	    bgColor: '#000000',
		ajax: {}, // Ajax option (url, data, type, success will be overwritten for a form, url and success only for an ajax call)
		swf: { // Swf player options if swf type is used.
		wmode: 'transparent'
		},
		width: null, // default Width If null, will be calculate automatically
		height: null, // default Height If null, will be calculate automatically
		minHeight: 90, // Minimum height
		resizable: true, // Indicate if the content is resizable. Will be set to false for swf
		autoSizable: true, // Indicate if the content is auto sizable. If not, the min size will be used
		padding: 15, // padding for the max modal size
		regexImg: '[^\.]\.(jpg|jpeg|png|tiff|gif|bmp)\s*$', // Regex to find images
		addImageDivTitle: false, // Indicate if the div title should be inserted
		defaultImgAlt: 'Image', // Default alt attribute for the images
		setWidthImgTitle: true, // Set the width to the image title
		ltr: true, // Right to left by default. Put to false for Hebrew or Left to Right language
		gallery: null, // Gallery name if provided
		galleryLinks: '<a href="#" class="nyroModalPrev">Prev</a><a href="#"  class="nyroModalNext">Next</a>', // Use .nyroModalPrev and .nyroModalNext to set the navigation link
		// galleryCounts: galleryCounts, // Callback to show the gallery count
		galleryLoop: false, // Indicate if the gallery should loop
		zIndexStart: 100,

		cssOpt: { // Default CSS option for the nyroModal Div. Some will be overwritten or updated when using IE6
			bg: {
			  position: 'absolute',
			  overflow: 'hidden',
			  top: 0,
			  left: 0,
			  height: '100%',
			  width: '100%'
			},
			wrapper: {
			  position: 'absolute',
			  top: '40%',
			  left: '50%'
			},
			wrapper2: {
			},
			content: {
			},
			loading: {
			  position: 'absolute',
			  top: '50%',
			  left: '50%',
			  marginTop: '-50px',
			  marginLeft: '-50px'
			}
		  },
		wrap: { // Wrapper div used to style the modal regarding the content type
			div: '<div class="wrapper"></div>',
			ajax: '<div class="wrapper"></div>',
			form: '<div class="wrapper"></div>',
			formData: '<div class="wrapper"></div>',
			image: '<div class="wrapperImg"></div>',
			swf: '<div class="wrapperSwf"></div>',
			iframe: '<div class="wrapperIframe" style="border: 10px solid;"></div>',
			iframeForm: '<div class="wrapperIframe"></div>',
			manual: '<div class="wrapper"></div>'
		},
		closeButton:'<div class="modalHeaderSpacer"></div><div class="modalBgClose"></div><div class="modalBordureDroite"></div> <div class="modalBgTQT"></div><a href="#" class="nyroModalClose" id="closeBut" title="Fermer">Fermer</a>',
		openSelector: '.nyroModal', // selector for open a new modal. will be used to parse automaticly at page loading
		closeSelector: '.nyroModalClose', // selector to close the modal
		contentLoading: '<a href="#" class="nyroModalClose">Cancel</a>', // Loading div content
		errorClass: 'error', // CSS Error class added to the loading div in case of error
		contentError: '<div id="erreur" class="nyroModalClose"></div>',
		handleError: null, // Callback in case of error
		// showBackground: showBackground, // Show background animation function
		// hideBackground: hideBackground, // Hide background animation function
		endFillContent: null, // Will be called after filling and wraping the content, before parsing closeSelector and openSelector and showing the content
		showContent: function(elts, settings, callback) {
			elts.contentWrapper
			.css({
				width: settings.width+'px',
				height: settings.height+'px',
				marginTop: settings.marginTop+'px',
				marginLeft: settings.marginLeft+'px'
			})
			.show();
			elts.loading.fadeOut(200, callback);
			$('#nyroModalFull').css('zIndex',1500);
		},
		endShowContent: null, // Will be called once the content is shown
		// endShowContent: function(){
		//	$(".star_midground").show().animate({backgroundPosition:"(-40000px -2000px)"}, 960000, 'linear');
		//	$(".star_foreground").show().animate({backgroundPosition:"(-40000px -2000px)"}, 480000, 'linear');
		//},
		beforeHideContent: null, // Will be called just before the modal closing

		hideContent: function(elts, settings, callback) {
			// $(".fullsize-wrapper").hide();
			elts.contentWrapper.hide();
			callback();
		},

		// showTransition: showTransition, // Show the transition animation (a modal is already shown and a new one is requested)
		// hideTransition: hideTransition, // Hide the transition animation to show the content
		showLoading: function(elts, settings, callback) {
			callback();
		},
		// hideLoading: hideLoading, // hide loading animation function
		// resize: resize, // Resize animation function
		endResize: null, // Will be called one the content is resized
		// updateBgColor: updateBgColor, // Change background color animation function
		endRemove: null // Will be called once the modal is totally gone
	});








		$("#slide_master_2").show();
		$("#slider_2").easySlider({
			auto: true,
			continuous: true,
			numeric: true,
			pause: 4000
		});


		$("#slide_master_3").show();
		$("#slider_3").easySlider({
			auto: true,
			continuous: true,
			numeric: false,
			orientation: 'vertical',
			pause: 4000
		});
		


	/** CHECKBOX ALL SELECT **/
	$("#checkboxall").click(function()
	{
		var checked_status = this.checked;
		$("input[id=checkall]").each(function()
		{
			this.checked = checked_status;
		});
	});



	/** INSCRIPTION **/
	/*$("#form :input").tooltip({

	    position: "center left",
	    //offset: [-255, -550],
	    effect: "fade",
	    opacity: 1,
	    tip: '.tooltip'


	});*/



	/** TEXTE RAINBOW **/
	$('.degrade_petit').FontEffect({
	outline:true,
	outlineColor1:"#ffffff",
	outlineColor2:"#ffffff",
	gradient:false, /* pb ie7 */
	gradientColor:"#ffffff",
	gradientPosition:10,
	gradientLength:50,
	gradientSteps:10,
	shadow :false,
	shadowColor :"#000",
	shadowOffsetTop :2,
	shadowOffsetLeft:2,
	shadowBlur :1
	})

	$('.degrade_gros').FontEffect({
	outline:true,
	outlineColor1:"#ffffff",
	outlineColor2:"#ffffff",
	outlineWeight :2,
	gradient:false, /* pb ie7 */
	gradientColor:"#FF6600",
	gradientPosition:10,
	gradientLength:50,
	gradientSteps:10,
	shadow :true,
	shadowColor :"#000",
	shadowOffsetTop :2,
	shadowOffsetLeft:2,
	shadowBlur :1 /* The shadow blur 1=none,2=low,3=high */
	})
});
