// JavaScript Document

	Event.observe(window, 'load', function() {	
	
	$$('.bulle').each(function(element) {
	 new Tip(element, element.title);
	 element.title = '';
	});
	
	$$('.bandeau').each(function(element) {
	 var h2 = element.up(0).down(1).down(0).down('.infos').down(0).down(0);
	 var color = h2.getStyle('color');
	 new Tip(element, '<span style="color: '+color+'">Site '+h2.innerHTML+'</span>', { style: 'darkgrey', borderColor: color });
	});
						   
	 $$('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 content_height = $('content').getHeight();
		var bottom_height = $('bottom').getHeight();
		var total_height = parseInt(content_height)+parseInt(bottom_height);
		var height_ideal = parseInt(height-bottom_height-parseInt($('content').getStyle('paddingTop')));
		
		if(total_height < height) $('content').setStyle({ minHeight : height_ideal+'px' });
	}

