// JavaScript Document

	Event.observe(window, 'load', function() {	
										   
	 $$('a[href^=#]:not([href=#])').each(function(element) {
		element.observe('click', function(event) {
		  new Effect.ScrollTo(this.hash.substr(1));
		  Event.stop(event);
		}.bindAsEventListener(element))
	  });
	 
	 	// Gestion de la hauteur d'écran
		resizePrincipale();
		
		Event.observe(document.onresize ? document : window, "resize", resizePrincipale);

	});
	
	function resizePrincipale() {
		var height = document.viewport.getHeight();
		var top_height = $('top').getHeight();
		var page_height = $('page').getHeight();
		var bottom_height = $('bottom').getHeight();
		var total_height = parseInt(top_height)+parseInt(page_height)+parseInt(bottom_height);
		var height_ideal = parseInt(height-total_height-50+page_height);
		
		if(total_height < height) $('page').setStyle({ minHeight : height_ideal+'px' });
	}

