var images = new Array(
	new Array(
		'/images/header/menu-h/item-1-over.png',
		'/images/header/menu-h/item-2-over.png',
		'/images/header/menu-h/item-3-over.png',
		'/images/header/menu-h/item-4-over.png',
		'/images/header/menu-h/item-5-over.png',
		'/images/header/menu-h/item-6-over.png',
		'/images/header/menu-h/item-7-over.png'
	)
);

function trim (myString)
{
	return myString.replace(/^\s+/g,'').replace(/\s+$/g,'');
} 

/* Masque le label de recherche lorsque le champ reçoit le focus */
$(document).ready(function() {
	$('#moteur-de-recherche').submit(function(){
		if(trim($('#header-box-recherche-input-q').val()) == '')
			return false;
		else
			return true;
	});
	
	if ($('#header-box-recherche-input-q').val() == '') {
		$('#header-box-recherche-input-q-box label').css('display', 'block');
	}
	$('#header-box-recherche-input-q').focus(function() {
		$('#header-box-recherche-input-q-box label').css('display', 'none');
		$('#header-box-recherche-input-q').select();
	}).blur(function() {
		if ($(this).val() == '') {
			$('#header-box-recherche-input-q-box label').css('display', 'block');
		}
	});
	
	if ($('#ec-login').val() == '') {
		$("label[for='ec-login']").css('display', 'block');
	}
	$('#ec-login').focus(function() {
		////alert('55');
		$("label[for='ec-login']").css('display', 'none');
		if ($('#ec-password').val() != '') {
			$("label[for='ec-password']").css('display', 'none');
		}
	}).blur(function() {
		if ($(this).val() == '') {
			$("label[for='ec-login']").css('display', 'block');
		}
		if ($('#ec-password').val() != '') {
			$("label[for='ec-password']").css('display', 'none');
		}
	});
	
	if ($('#ec-password').val() == '') {
		$("label[for='ec-password']").css('display', 'block');
	}
	$('#ec-password').focus(function() {
		$("label[for='ec-password']").css('display', 'none');
	}).blur(function() {
		if ($(this).val() == '') {
			$("label[for='ec-password']").css('display', 'block');
		}
	});
	
	if ($('#newsletter-email').val() == '') {
		$("label[for='newsletter-email']").css('display', 'block');
	}
	$('#newsletter-email').focus(function() {
		$("label[for='newsletter-email']").css('display', 'none');
	}).blur(function() {
		if ($(this).val() == '') {
			$("label[for='newsletter-email']").css('display', 'block');
		}
	});
	
	 for( var i=0; i<images.length; i++ )
		 for( var j=0; j<images[i].length; j++ )
		 MM_preloadImages( images[i][j] ); 
});

function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

