function promo() {
	$('#news').css('display', 'block');
}

function promo2() {
	$('#news').css('display', 'none');
}

function compte() {
	$('#identification').css('display', 'block');
}

function compte2() {
	$('#identification').css('display', 'none');
}

function mc(n) {
	for( i = 1; i < 9; i++) {
		$('#c' + i).css('display', 'none');
		$('#marche' + i).attr('class', '');
	}
	$('#c' + n).css('display', 'block');
	$('#marche' + n).attr('class', 'activeM');
}

function layerSC() {
	$('#layerSC').css('display', 'block');
}

function FlayerSC() {
	$('#layerSC').css('display', 'none');
}

function display_suggest(res) {
	if(res.length > 0) {
		$('#search_autocomplete').html(res);
		$('#search_autocomplete').css('display', 'block');

		jQuery('#search_autocomplete li').click(function() {
			$('#recherche').val($(this).html().replace(/<.*>/, ''));
			$('#search_autocomplete').css('display', 'none');
		});
		jQuery('#search_autocomplete li').mouseover(function() {
			$(this).css('background', '#B5B5B5');
		});
		jQuery('#search_autocomplete li').mouseout(function() {
			$(this).css('background', '#E0E0E0');
		});
	} else {
		$('#search_autocomplete').css('display', 'none');
	}
}

jQuery(document).ready(function() {
	jQuery('.newsIns').validate();
	jQuery('#mycarousel').jcarousel({
		scroll : 5
	});
	jQuery('.menu2').mouseout(function() {
		jQuery(this).hide();
		jQuery('.gaucheH .menu ul li a').removeClass('activeM');
	});

	jQuery('.menu a').mouseout(function() {
		if(jQuery.browser.msie) {
			if(jQuery.browser.version > 6) {
				jQuery('.menu2').hide();

			}
		} else {
			jQuery('.menu2').hide();
		}
		jQuery('.gaucheH .menu ul li a').removeClass('activeM');
	});

	jQuery('.menu2').mouseover(function() {
		jQuery(this).show();
		jQuery('#marche' + jQuery(this).attr('menu')).addClass('activeM');
	});

	jQuery('#recherche').keyup(function() {
		
		var q = $('#recherche').val();
		if(q.length > 2) {
			$.ajax({
				type : 'GET',
				url : '/catalogsearch/ajax/suggest/q/' + q,
				success : display_suggest
			});
		} else {
			display_suggest('');
		}
	});
	if(jQuery("#s4").children().size() > 1) {
		jQuery('#s4').before('<div id="nav" class="nav">').cycle({
			fx : 'toss',
			speed : 1500,
			timeout : 3000,
			pager : '#nav',
			animOut : {
				top : 0,
				left : -600
			}

		});
	}
});
