var Site = {
		
	start: function(){
		
		Site.setExternals();
		Site.fixExplorer();
		
		if( $$('toggler') ) Site.setAccordeon();
		
		if( $('contactproduct') ) Site.setAccordeonCommander();
		
	},
	
	setExternals: function(){
		$$('.external').addEvent('click', function(ev){
			window.open(this.href); new Event(ev).stop(); return; });
	},

	fixExplorer: function() {
		
		$('container').getElements('input[type=radio]').setStyle('border', '0');
		$('container').getElements('input[type=checkbox]').setStyle('border', '0');
		
		$$('textarea').addEvents({
			'focus': function(){ this.addClass('highlight');},
			'blur': function(){ this.removeClass('highlight');}
		});
		
		$$('select').addEvents({
			'focus': function(){ this.addClass('highlight');},
			'blur': function(){ this.removeClass('highlight');}
		});
	},
	
	setAccordeon: function() {
		
		$$('.toggler').setStyle('cursor','pointer');
		
		/*
		$$('.toggler').addEvents({
			'mouseover': function(){ this.addClass('toggler_hover'); },
			'mouseout': function(){ this.removeClass('toggler_hover'); }
		});
		*/
		
		var myAccordion = new Accordion($('liste_produits'), 'h3.toggler', 'div.accordeon', {
			opacity: false,
			onActive: function(toggler, element){
				toggler.addClass('toggler_hover');
			},
			onBackground: function(toggler, element){
				toggler.removeClass('toggler_hover');
			}
		});
	},
	
	setAccordeonCommander: function() {
		
		$$('#contactproduct h5').setStyle('cursor','pointer');
		$$('#contactproduct h5').setStyle('margin-top','5px');
		$$('#contactproduct div.categorie_produit').setStyle('margin-bottom','15px');
		
		var myAccordion = new Accordion($('contactproduct'), 'h5', 'div.categorie_produit', {
			opacity: false
			
		});
	}
	
};

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


        if($('rechercher')!=null)
        {
            $('rechercher').addEvents({
                'click': function()
                {
                    if(this.value=="Entrer un mot clé")
                    {
                        this.value="";
                        this.setStyle('color', '#000');
                    }
                }
            });
        }
});


