jQuery(document).ready(function() {
    jQuery('a.innerBox').fancybox({
		overlayShow: true,
		hideOnContentClick: false,
		frameWidth: 800,
		frameHeight: 600,
		overlayOpacity: 0.85,
		centerOnScroll: false
	});
     jQuery('a').filter(function() {  
       return this.hostname && this.hostname !== location.hostname;  
     }).attr('target', '_blank');  

	jQuery('#weathermsn').html('<object type="application/x-shockwave-flash" data="http://weather.eu.msn.com/f5/loader19.swf?lang=FR&amp;mode=continent&amp;continent=Europe&amp;defaultCountry=FR" width="428" height="307"><param name="movie" value="http://weather.eu.msn.com/f5/loader19.swf?lang=FR&amp;mode=continent&amp;continent=Europe&amp;defaultCountry=FR" /><param name="wmode" value="transparent" /></object>');
     
     jQuery('.blocheader select').change(function () {
     	if (jQuery(this).val() != '')
	     	jQuery(this).parents('form').submit();
     });

     jQuery('.blocdomainmain .blocheader select[name=id_departement]')
     	.unbind('change')
     	.change( function () {
     	if (jQuery(this).val() != '')
     	{
	     	var form = jQuery(this).parents('form');
	     	jQuery('select[name!=id_departement]', form).val('');
	     	jQuery(form).submit();
	     }
     });

     jQuery('.bloctechnicalmain .blocheader select[name=id_type]')
	  	.unbind('change')
	  	.change( function () {
	  	if (jQuery(this).val() != '')
	  	{
	     	var form = jQuery(this).parents('form');
	     	jQuery('select[name!=id_type]', form).val('');
	     	jQuery(form).submit();
	     }
	 });

     jQuery('.blocproductmain .blocheader select[name=id_type]')
	  	.unbind('change')
	  	.change( function () {
	     	var form = jQuery(this).parents('form');
	     	jQuery('select[name=id_product]', form).val('');
	     	jQuery(form).submit();
	});
     jQuery('.blocproductmain .blocheader select[name=id_manufacturer]')
	  	.unbind('change')
	  	.change( function () {
	  	if (jQuery(this).val() != '')
	  	{
	     	var form = jQuery(this).parents('form');
	     	jQuery('select[name!=id_manufacturer]', form).val('');
	     	jQuery(form).submit();
	     }
	});

	jQuery('#footer_links input[name=q]').focus( function() {
		if (jQuery(this).val() == 'RECHERCHE')
			jQuery(this).val('');
	});
	jQuery('#footer_links form').submit( function() {
		if (jQuery('input[name=q]', this).val() == 'RECHERCHE')
			return false;
	});
	jQuery('#footer_links input[name=q]').blur( function() {
		if (jQuery(this).val() == '')
			jQuery(this).val('RECHERCHE');
	});
	
		jQuery('.menu-ul>li').hoverIntent( {    
		     sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
		     interval: 100, // number = milliseconds for onMouseOver polling interval    
		     over: function() {
					$('.sub', this).css('display', 'block');
				},    
		     timeout: 500, // number = milliseconds delay before onMouseOut    
		     out: function() {
					if (!$(this).hasClass('active'))
						$('.sub', this).css('display', 'none');
				}    
		});
	
	jQuery('.blocmain .bloccontent .col1 .title').each(function() {
		if (jQuery(this).text().length > 50)
			jQuery(this).marquee().addClass('title');
	});
});	
