var Site = {
		
	start: function(){
		
		$$('.external').addEvent('click', function(ev){
				window.open(this.href); 
				new Event(ev).stop(); 
				return; 
		});
		
		if($('choixProduits'))	Site.change();
		if($('rightcolumn')) Site.opacity();
		if($('input_search')) Site.rechercher();
		
		if($('slideshow'))
			new BarackSlideshow('menu', 'pictures', 'loading', {transition: 'fade', auto:true, autostart: true});

		
	},
	
	rechercher : function(){
		
		$('input_search').addEvents({
			
			'focus': function() {
				if(this.value=='Rechercher') 
					this.value='';			
			},	
			
			'blur': function() {
				if(this.value=='') 
					this.value = 'Rechercher';			
			}
				
		});	
		
	},	
	
	change : function(){
		
		var familles = $('choixProduits').getElements('option[]');
	
		$('choixProduits').addEvent('change', function(){
			url = $('formProduits').action + this.value + '/';			
			location.href = url;	
	    });
	
		familles.each(function(element){
		
			if(element.value!=-1){
				
				element.addEvent('mouseover', function(){
					this.addClass('active');
			    });
				
				element.addEvent('mouseout', function(){
					this.removeClass('active');
			    });
				
			}
			
		});	
	},
	
	opacity : function(){
		
		var labels = $('rightcolumn').getElements('a[]');
	
		labels.each(function(element){
			
			if(element.get('class')=='external selected'){
			
				element.set('opacity','.' + 30);
			
			}else{
			
				element.addEvent('mouseover', function(){
					element.set('opacity','.' + 30);
			    });
				
				element.addEvent('mouseout', function(){
					element.set('opacity',1);
			    });

			}
			
		});	
	},
	
	link : function(){

		$$('.more').setStyle('display','none');
		
		$('blocActus').setStyle('cursor','pointer');
		a = $$('.more').href;
		
		$('blocActus').addEvent('click', function(){
			window.open(this.href); 
			document.location = a; 
		});	
	
	}
		
	
}



window.addEvent('domready', function(){
	Site.start();
});



