$(document).ready(function(){
	//Menu déroulant
	$('ul.menu').menuBox();
	
	//Lien pour nouvelle page
	$('a[class^="_blank"]').click(function(){
		window.open(this.href, '_blank');
		return false;
    });
	
	//Diaporama accueil
	if( $('#slides').length ){
		$('#slides').slides({
			effect: 'fade',
			preload: true,
			preloadImage: '../img/loading.gif',
			play: 5000,
			hoverPause: false,
			fadeSpeed: 800,
			crossfade: true,
			generateNextPrev: false,
			generatePagination: false,
			animationComplete: function(current){
				$('#onglets a').removeClass('courant');
				$('a#num-'+current).addClass('courant');
			}
		});
	}
	
	//Lightbox
	if( $("a[class^='lightbox']").size() > 0 ){
		$("a[class^='lightbox']").prettyPhoto({
			deeplinking : false,
			social_tools: ""
		});
	}
	
	//Recherche
	$('#zone-recherche input#recherche').focus(function(){
		if ($(this).attr('value') == 'Rechercher un produit...'){
			$(this).attr('value','');
		}
	});
	$('#zone-recherche input#recherche').blur(function(){
		if ($(this).attr('value') == ''){
			$(this).attr('value','Rechercher un produit...');
		}
	});
	
	$('input.placeholder').focus(function(){
		if ($(this).attr('value') == 'E-mail'){
			$(this).attr('value','');
		}
	});
	$('input.placeholder').blur(function(){
		if ($(this).attr('value') == ''){
			$(this).attr('value','E-mail');
		}
	});
});
