$(function() {
	if ($.browser.msie && $.browser.version == 6){
		$('div#mininuage').css('display', 'none');
		
		$('div#categories_block ul li').hover(function() {
			$(this).find('ul').css('display', 'block');
		}, function() {
			$(this).find('ul').css('display', 'none');
		});
	}
	if ($.browser.msie && $.browser.version == 7){
		$('div#categories_block ul li ul').each(function() {
			var dekal = '-'+$(this).parent().width()+'px';
			$(this).css('margin-left', dekal);
		});
	}



	if( $('#search_query').attr('value')=='' )
		$('#search_query').attr('value', 'Rechercher');

	$('#search_query').focus(function() {
		if( $('#search_query').attr('value')=='Rechercher' )
			$('#search_query').attr('value', '');
	});

	$('#search_query').blur(function() {
		if( $('#search_query').attr('value')=='' )
			$('#search_query').attr('value', 'Rechercher');
	});
	
	
	
	$('#categories_liste select').change(function() {
		window.location.href = $(this).attr('value');
	});
	
	
	
	$('div#categories_block ul li.cat_14>a').click(function() {
		return false;
	});



	$('#gammes_home ul li a, ul#product_list li a, #productscategory_list ul li a, #liste_themes ul li a').mouseover(function(e) {
		
		var tip0 = $(this).parent().find('strong');
		if( !tip0.length ) {
			var tip0 = $($(this).parents().get(1)).find('strong');
		}
		if( !tip0.length ) {
			var tip0 = $($(this).parents().get(2)).find('strong');
		}
		

		var tip = tip0.text();
		
		
		$(this).attr('title','');
		
		
		if( tip!='' && tip!='null' && tip!=null ) {
			$(this).append('<div id="tooltip">' + tip + '</div>');
			$('#tooltip').css({'opacity': 0.1, 'line-height': '1.1em'});
			
			$('#tooltip').css('top', e.pageY - 40 );
			$('#tooltip').css('left', e.pageX + 15 );
			$('#tooltip').fadeTo(500,0.9);
		}
		
	}).mousemove(function(e) {
		$('#tooltip').css('top', e.pageY - 40 );
		$('#tooltip').css('left', e.pageX + 15 );
	}).mouseout(function() {
		//$(this).attr('title',$('div#tooltip').html());
		$(this).children('div#tooltip').remove();
	});
});




function go_flash(swf,haut,large,remplace)
{
	var altern = '';
	if( remplace!='' )
		altern = '<img src="'+ remplace +'" alt="" />';
	document.write('<object type="application/x-shockwave-flash" data="'+ swf +'" width="'+ large +'" height="'+ haut +'"><param name="movie" value="'+ swf +'" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" />'+altern+'</object>');
}











