function ouvrir_volets( label ) {
	var test_label = label.attr('id');
	switch ( test_label ) {
		case 'afficherlademandedevis':
			label.height(320);
			break;
		case 'lesoptions':
		case 'votrerecherche':
		case 'famille':
			label.css('right', 0);
			break;
		case 'afficherlesrubriques':
			label.css('left', -10);
			break;
	}
}

function fermer_volets( label ) {	
	var test_label = label.attr('id');
	switch ( test_label ) {
		case 'afficherlademandedevis':
			label.height(34);
			break;
		case 'lesoptions':
		case 'votrerecherche':
		case 'famille':
			label.css('right', -227);
			break;
		case 'afficherlesrubriques':
			label.css('left', -236);
			break;
	}
}

function ouvrir_fermer_volets() {
	$('.onglet').click(function() {
		ouvrir_volets( $(this).parent() );
	});
	$('.volet').mouseleave(function() {
		fermer_volets( $(this) );
	});
}

//------------------------------------------------------------------ 

function ouvrir_fermer_menu_deroulant() {
	$('.menu_deroulant, #afficherlesrubriques .content ul, #accueil .right ul').hover(function(){
		$(this).children('a').css({'color':'#243443'});
		ouvrir_fermer_sousmenu_deroulant();
	},function(){
		$(this).children('a').css({'color':'#89c6ff'});
	});
};

function ouvrir_fermer_sousmenu_deroulant() {
	$('.menu_deroulant ul li, #afficherlesrubriques .content ul li, #accueil .right ul li').hover(function(){
		$(this).children('ul').css({'display':'block'});
		if((!$(this).children('ul.sousrub'))||(!$(this).children('ul.sousrub li'))){
			$(this).children('ul li a').css({
				'color':'#fff',
				'backgroundColor' : '#2897df'	
			});
		}
	},function(){
		$(this).children('ul').css({'display':'none'});
		if((!$(this).children('ul.sousrub'))||(!$(this).children('ul.sousrub li'))){
			$(this).children('ul li a').css({
				'color':'#243443',
				'backgroundColor' : 'transparent'	
			});
		}
	});
};

//------------------------------------------------------------------ 

function masquer_les_legendes( label ) {
	var test_label = label.attr('id');
	switch ( test_label ) {
		case 'q':
			label.css('background','transparent url(http://www.arc-roulettes.com/css/template/recherche_input.gif) no-repeat left bottom');
			break;
	}
}

function afficher_les_legendes( label ) {
	var test_label = label.attr('id');
	switch ( test_label ) {
		case 'q':
			label.css('background','transparent url(http://www.arc-roulettes.com/css/template/recherche_input.gif) no-repeat left top');
			break;
	}
}

function afficher_masquer_les_legendes( label  ){
	$( label ).focus(function(){
		masquer_les_legendes( $(this) );
	});
	$( label ).blur(function(){
		if ( jQuery.trim($('#q').val()) == "" ) {
			afficher_les_legendes( $(this) );
		};
	});
	if( jQuery.trim($('#q').val()) != "" ) {
		masquer_les_legendes( $('#recherche input:text') );
	};
}

//------------------------------------------------------------------ 

function labelForm() {
	$('#afficherlademandedevis form input[type="text"], #afficherlademandedevis form textarea, #static .left form [type="text"], #static .left form textarea').focus(function(){
		$(this).css('backgroundPosition','0 -40px');
	}).blur(function(){
		if(($(this).val()=="")&&($(this).text()=="")) {
			($(this).attr('name')=='devis')?$(this).css('backgroundPosition','0 6px'):$(this).css('backgroundPosition','left center');
		}
	});
}













