// JavaScript Document
// un background toujours visible, dependant la largeur et hauteur de la page
window.addEvent('domready', function() {

	// resize the background please
	resize_background_image_now();	
});
window.addEvent('resize', resize_background_image_now);

function resize_background_image_now()
{	
	var bg = $('background').getElement('img');
	
	var ratio = 12/8;
	
	bg.set('width', window.getWidth());
	bg.set('height', window.getWidth() / ratio);
	
	if (bg.getStyle('height').toInt() < window.getHeight()) {
		bg.set('height', window.getHeight());
		bg.set('width', window.getHeight() * ratio);
	}
}
