Position.GetWindowSize = function(w) {
	var width, height;
	w = w ? w : window;
	width = w.innerWidth || (w.document.documentElement.clientWidth || w.document.body.clientWidth);
	height = w.innerHeight || (w.document.documentElement.clientHeight || w.document.body.clientHeight);

	return { width: width, height: height };
}
var fixBack = function() {
	var dim = Position.GetWindowSize();
	if (!$('bloc-moulure')) {
		var div = new Element ('div',{'id':'bloc-moulure'});
		div.addClassName('moulure');
		$('container').insert({before:div});
	} else {
		var  div=$('bloc-moulure');
	}
	var hauteurUtile = dim.height;
	var hauteurConteneur = $('container').getHeight();
	if ((hauteurUtile-hauteurConteneur)>0) {
		if (hauteurConteneur==694) {
			reste = hauteurUtile-hauteurConteneur;
			if (reste>122) {
				div.setStyle({
					'height':'122px',
					'top':((hauteurUtile-(hauteurConteneur+122))/2)+'px',
					'display':'block'
				});
				$('container').style.top=""+((hauteurUtile-(hauteurConteneur+122))/2)+'px';
			} else {
				div.setStyle({
					'height':reste+'px',
					'top':((hauteurUtile-(hauteurConteneur+reste))/2)+'px',
					'display':'block'
				});
				$('container').insert({before:div});
				$('container').style.top=""+((hauteurUtile-(hauteurConteneur+reste))/2)+'px';
			}
		} else {
			div.setStyle({
				display:'none'
			});
			$('container').style.top=""+((hauteurUtile-hauteurConteneur)/2)+"px";
		}
	} else {
		div.setStyle({
			display:'none'
		});
		$('container').style.top="0px";
	}
};
Event.observe(window, 'resize', function() {
	fixBack();
});




