var Site = {
	
	session_vide: false,
	myTable: {},
	
	start: function(){
		
		if( $('email') && $('password') ) Site.loginBox();
		if( $$('.print') ) Site.fprint();
		if( $$('.itemCat') ) Site.hoverCategorie();			
		
		if( $$('.add') ) $$('.add').value ='';
		
		$$('.external').addEvent('click', function(ev){
				window.open(this.href); 
				new Event(ev).stop(); 
				return; 
		});
		
		
		$('input_search').addEvents({
				
				'click': function() {
					this.value='';			
				},	
				
				'blur': function() {
					if(this.value=='') 
						this.value = 'Entrer un mot clef';			
				}
					
		});	
		
		$$('.validate').addEvent('click', function(ev){
				if( !confirm("Si vous confirmez, votre panier sera totalements vid\351. Souhaitez-vous continuer ?") ) { 
					new Event(ev).stop(); return; 
				} 
		});
	},
	
	hoverCategorie : function(){
		
		$$('.itemCat').addEvents({
				
			'mouseover': function(){
				this.addClass('active');
			},
			
			'mouseout': function(){		
				this.removeClass('active');	
			}
					
		});			
		
	},
	
	fprint : function(){
		
		$$('.printing').addEvent(
				
			'click', function(e) {
				new Event(e).stop();
				window.print();
			});	
		
	},
	
	loginBox : function(){
		
		$('email').addEvents({
			
			'focus': function() {
				if(this.value=='E-mail') 
					this.value='';			
			},	
			
			'blur': function() {
				if(this.value=='') 
					this.value = 'E-mail';			
			}
				
		});	
	
		$('password').addEvents({
			
			'focus': function() {
				if(this.value=='Mot de passe') 
					this.value='';			
			},	
			
			'blur': function() {
				if(this.value=='') 
					this.value = 'Mot de passe';			
			}
				
		});	
	}
	
}



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


