
/**
* ClassName : Date
 * Description : prototype Date class : add params properrty object and getClass method. This method returns the CSS class matches with a particular moment in the day.
 */				


Date.prototype.params ={
	flashItem : $('illustrationsbox'),
	flashItem2 : $('bannieres_oas_p1'),
	morning : 7,
	afternoon : 12,
	evening : 19,
	morningImage : '/imagerie/phototheque/big-illustration-blue.jpg',
	afternoonImage : '/imagerie/phototheque/big-illustration-red.jpg',
	eveningImage : '/imagerie/phototheque/big-illustration-darkblue.jpg',
	morningClass : 'morning',
	afternoonClass : 'afternoon',
	eveningClass : 'evening'
}

Date.prototype.getClass = function(){
	var ret = '';
	var flashContent = '';
	if(this.getHours() > this.params.morning && this.getHours() <= this.params.afternoon){
		ret = this.params.morningClass;
		newDiv_bande= document.createElement('Div');
		newDiv_bande.className="bande_degrade_blue";
		this.params.flashItem2.appendChild(newDiv_bande);
		flashContent = '<img src="' + this.params.morningImage + '" alt="Flash" />';
	}else if(this.getHours() > this.params.afternoon && this.getHours() <= this.params.evening){
		ret = this.params.afternoonClass;
		newDiv_bande= document.createElement('Div');
		newDiv_bande.className="bande_degrade_red";
		this.params.flashItem2.appendChild(newDiv_bande);
		flashContent = '<img src="' + this.params.afternoonImage + '" alt="Flash" />';
	}
	else{
		ret = this.params.eveningClass;
		newDiv_bande= document.createElement('Div');
		newDiv_bande.className="bande_degrade_darkblue";
		this.params.flashItem2.appendChild(newDiv_bande);
		flashContent = '<img src="' + this.params.eveningImage + '" alt="Flash" />';
	}
	if(this.params.flashItem.innerHTML == '')
		this.params.flashItem.innerHTML = flashContent;
	return ret;
}

Event.observe(window, 'load', function(){
	new SUI_OverBox();
	
	SUI_BookingBox.load();
	SUI_Engine.load();
	SUI.ajax.init();
	
	SUI_Popup.load();
	var theDate = new Date();
	document.body.className = document.body.className + ' ' + theDate.getClass();
});