var Site = {
			start: function(){	
				
				Site.toolTipLinks();
				Site.uploadPics();
				Site.coupon();
				//Site.autocomplete();
				
				/*if ($('sidebar')){
					Site.appearText();
					if (!window.ie6) Site.makeShadow();
				}*/
			},
			
			toolTipLinks: function(){
				/* Tips 2 */
				var monTip = new Tips($$('.tips'), {
					initialize:function(){
						this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
					},
					onShow: function(toolTip) {
						this.fx.start(1);
					},
					onHide: function(toolTip) {
						this.fx.start(0);
					},
					fixed: true
				});
			},
			
			autocomplete: function(){
				
				var recherche = $('depart');
				
				/**
				 * Ajax
				 */
				var indicator3 = new Element('div').addClass('autocompleter-loading').setHTML('').setStyle('display', 'none').injectAfter(recherche);
		
				var completer3 = new Autocompleter.Ajax.Xhtml(recherche, 'auto.php', {
					'postData': {html: 1},
					'onRequest': function(recherche) {
						//alert('test1');
						indicator3.setStyle('display', '');
					},
					'onComplete': function(recherche) {
						//alert('test2');
						indicator3.setStyle('display', 'none');
					},
					'parseChoices': function(recherche) {
						//alert('test3');
						var value = recherche.getFirst().innerHTML;
						recherche.inputValue = value;
						this.addChoiceEvents(recherche).getFirst().setHTML(this.markQueryValue(value));
					}
				});
				
				var recherche2 = $('arrivee');
				
				/**
				 * Ajax
				 */
				var indicator4 = new Element('div').addClass('autocompleter-loading').setHTML('').setStyle('display', 'none').injectAfter(recherche2);
		
				var completer4 = new Autocompleter.Ajax.Xhtml(recherche2, 'auto.php', {
					'postData': {html: 1},
					'onRequest': function(recherche2) {
						//alert('test1');
						indicator4.setStyle('display', '');
					},
					'onComplete': function(recherche2) {
						//alert('test2');
						indicator4.setStyle('display', 'none');
					},
					'parseChoices': function(recherche2) {
						//alert('test3');
						var value = recherche2.getFirst().innerHTML;
						recherche2.inputValue = value;
						this.addChoiceEvents(recherche2).getFirst().setHTML(this.markQueryValue(value));
					}
				});
			},
			
			uploadPics: function(){
				if ($( 'formulaire' ).logo)
				new MultiUpload( $( 'formulaire' ).logo, 1, '[{id}]', true, true );
				
				if ($( 'formulaire' ).word)
				new MultiUpload( $( 'formulaire' ).word, 1, '[{id}]', true, true );
			},
			
			coupon: function(){
				if ($('formCoupon')) {
					$('formCoupon').addEvent('submit', function(e) {
						/**
						 * Prevent the submit event
						 */
						new Event(e).stop();
					 
						/**
						 * This empties the log and shows the spinning indicator
						 */
						var log = $('coupon_response').removeClass('coupon_error').empty().addClass('ajax-loading');
					 
						/**
						 * send takes care of encoding and returns the Ajax instance.
						 * onComplete removes the spinner from the log.
						 */
						this.send({
							update: log,
							evalScripts: true,
							onComplete: function() {
								log.removeClass('ajax-loading');
							}
						});
					});
				}
			}
		};
		
		window.addEvent('domready', Site.start);