$(document).ready(function () {
	//
	// Drop Down Menu
	//
	function mainmenu(){
	$(" #nav ul ").css({display: "none"}); // Opera Fix
	$(" #nav li").hover(function(){
			$(this).find('ul').css({visibility: "visible",display: "none"}).fadeIn(400);
			},function(){
			$(this).find('ul').css({visibility: "hidden"});
			});
	}
	mainmenu();
	
	// Change arrow on hover
	$("li.liSub").hover(function(){
		$(this).find("span img").attr("src", "/wp-content/themes/brainsonic/images/arrow_hover.png");
	},function(){
		$(this).find("span img").attr("src", "/wp-content/themes/brainsonic/images/arrow.png");
	});
	//
	// Desaturate effect
	//
	$.fn.desaturate = function() {
		return this.each(function(){
			$(this).hover(
				function(){
					$(this).children('img').fadeTo('normal',100);
				},
				function(){
					$(this).children('img').fadeTo('normal',0);
				}
			);		
		})
	}
	$('a.nyroModal').nyroModal({
		bgColor: 'white',
		closeButton: '<a href="#" class="nyroModalClose" id="closeBut" title="fermer">Fermer</a>',
		showContent: showContent,
		hideContent: hideContent
	});
	function showContent(elts, settings, callback) {
	  elts.contentWrapper
	    .css({ // Reset the CSS at the start position
	      marginTop: (settings.marginTop)+'px',
	      marginLeft: (settings.marginLeft)+'px'
	    })
	    .fadeIn({duration: 1000});
	}
	function hideContent(elts, settings, callback) {
	  elts.contentWrapper
	    .fadeOut({duration: 800, complete: function() {
				elts.contentWrapper.hide();
				callback();
			}});
	}
	/*$('#btnNext a').click(function(){
		//$("#formNewsletter").validate().element( "#myselect" );
		$('#formNewsletter').animate({'left': '-350px'}, 'slow');
		$('ol li:first-child').removeClass('active');
		$('ol li:last-child').addClass('active');
		$(this).hide();
		return false;
	});*/
});

