// JavaScript Document

$(document).ready(function(){
   
	/* PNG FIX IE-6 */
	
	$(document).pngFix();
	
	/* BOUTON ENTRER HOME */
	
	$("#entrerBtn a").hover(function() {
		
		$('#entrerBtn').fadeTo('fast', 0.8, function() {
		      // Animation complete.
		    });		
		
	}, function() {
		
		$('#entrerBtn').fadeTo('fast', 1, function() {
		      // Animation complete.
		    });			
		
	});	
	
	/* MENU */
	
	$("ul#nav li a").hover(function () {
		$("span", this).hide();
		$(this).css("background-position","left bottom");
	}, function () {
		$("span", this).hide();
		$("ul#nav li a").css("background-position","left top");
	});
	
	/* ROLLOVER FLY HOME */
	
	$("#flyer a").hover(function() {
		
		$('#flyer').fadeTo('fast', 0.85, function() {
		      // Animation complete.
		    });		
		
	}, function() {
		
		$('#flyer').fadeTo('fast', 1, function() {
		      // Animation complete.
		    });			
		
	});
	
	/* ROLLOVER BOUTON HOME */
	
	$("#pushNewsAccueil a").hover(function() {
		
		$('#pushNewsAccueil').fadeTo('fast', 0.85, function() {
		      // Animation complete.
		    });		
		
	}, function() {
		
		$('#pushNewsAccueil').fadeTo('fast', 1, function() {
		      // Animation complete.
		    });			
		
	});
	
	/* ROLLOVER DIAPO */
	
	$("#tabPhoto .diapo").hover(function() {
		
		$(this).fadeTo('fast', 0.65, function() {
		      // Animation complete.
		    });		
		
	}, function() {
		
		$(this).fadeTo('fast', 1, function() {
		      // Animation complete.
		    });			
		
	});	
	
	// Detect Flash
	
	if (navigator.mimeTypes ["application/x-shockwave-flash"] == undefined) {
	
		$("#titreNewsletter").hide();
		
	}

	
	/*$("#tool").hide();*/
	
	/*$('#soirees').mousemove(function(e){
	    //$('#soirees').html("X: " + e.pageX + " Y: " + e.pageY);
	    console.log("X: " + e.pageX + " Y: " + e.pageY);
	    
	    if (e.pageY < 300) {
	    	$("#tool").show();
	    } else {
	    	$("#tool").hide();
	    }
	    
	});	*/
	
	/*********************************************************/
	/**************FANCY BOX *********************************/
	
	$("#newsAccueil").fancybox({
		'overlayOpacity'    : '0.8',
		'overlayColor'      : '#000',
		'padding'           : '0',
		'titlePosition'		: 'over',
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade'
	});
	
	$("#newsTarifs").fancybox({
		'overlayOpacity'    : '0.8',
		'overlayColor'      : '#000',
		'padding'           : '0',
		'titlePosition'		: 'over',
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade'
	});
	
	$("#newsSoirees").fancybox({
		'overlayOpacity'    : '0.8',
		'overlayColor'      : '#000',
		'padding'           : '0',
		'titlePosition'		: 'over',
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade'
	});		
	
	$("#partenaires").fancybox({
		'overlayOpacity'    : '0.8',
		'overlayColor'      : '#000',
		'padding'           : '0',
		'titlePosition'		: 'over',
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade'
	});	
	
	$("#reglement").fancybox({
		'overlayOpacity'    : '0.8',
		'overlayColor'      : '#000',
		'padding'           : '0',
		'titlePosition'		: 'over',
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade'
	});		
	
	$("#pushVideo1").fancybox({
		'overlayOpacity'    : '0.8',
		'overlayColor'      : '#000',
		'padding'           : '0',
		'titlePosition'		: 'over',
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade'
	});		
	
	$("a#flyer").fancybox({
		'overlayOpacity'    : '0.8',
		'overlayColor'      : '#000',		
		'opacity'		: true,
		'overlayShow'	: true,
		'transitionIn'	: 'fade',
		'transitionOut'	: 'none'
	});
	
	$("a#flyerSoiree").fancybox({
		'overlayOpacity'    : '0.8',
		'overlayColor'      : '#000',		
		'opacity'		: true,
		'overlayShow'	: true,
		'transitionIn'	: 'fade',
		'transitionOut'	: 'none'
	});	
	
	$("a[rel=bar_lounge]").fancybox({
		'overlayOpacity'    : '0.8',
		'overlayColor'      : '#000',		
		'opacity'		: true,
		'overlayShow'	: true,		
		'transitionIn'		: 'fade',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});		
   
 });
