$(function() {
	
	if ($.browser.msie && $.browser.version == 6)
		$('body').addClass('ie6');
	if ($.browser.msie && $.browser.version == 7)
		$('body').addClass('ie7');





	/* galerie d'images */
	
	if( $('div#dossiers_galerie ul.tree').length ) {
		//$('div#categories_block_left').html($('div#dossiers_galerie').html());
		$('#gal_menu_gauche').html('<div id="categories_block_left">'+$('div#dossiers_galerie').html()+'</div>');
		$('div#dossiers_galerie').html('');
		
		//$('#gal_menu_gauche').html($('div#dossiers_galerie').html());
	}





	$('#header_user ul#header_nav li').click(function() {
		window.location = $('#header_user ul#header_nav li:first a:first').attr('href');
	});
	
	
	
	$('div#categories_block_left li.cat_selected').parents().each( function() {
		if ($(this).is('ul'))
			$(this).css('display', 'block');
		if ($(this).is('li'))
			$(this).addClass('cat_selected');
	});



	$('#languages_block_top ul > li:last').css('border-right', 'none');

	if( $('#search_query').attr('value')=='' )
		$('#search_query').attr('value', $('form#searchbox input.button').attr('value'));
	$('#search_query').focus(function() {
		if( $('#search_query').attr('value')==$('form#searchbox input.button').attr('value') )
			$('#search_query').attr('value', '');
	});
	$('#search_query').blur(function() {
		if( $('#search_query').attr('value')=='' )
			$('#search_query').attr('value', $('form#searchbox input.button').attr('value'));
	});
	
	
	$('ul#product_list li, ul.liste_produit li').hover(function(){
			$(this).find('a.name').stop().animate({"marginTop": '-12px'}, 250);
		}, function() {
			$(this).find('a.name').stop().animate({"marginTop": 0}, 250);
	});
	
	





	/* liens auto sur certaines images */
	/* modif suite migration : on le met dans le tpl produit 
	$('#short_description_content img').each(function() {
		var thiz = $(this);
		var src = $(this).attr('src');
		var lien_auto = {
			'picto'		:	'content/10-la-qualite-platex'
		}
		$.each(lien_auto, function(i, v) {
			var test = (src+'').indexOf(i);
			if( test !== -1 ) {
				$(thiz).wrap('<a href="'+baseDir+v+'"></a>');
			}
		});
	});
	*/
	
	$('.screen_scene h2').css('opacity', 0.7);


});

