﻿if (Prototype.Browser.IE){
try {
	  document.execCommand("BackgroundImageCache", false, true);
	} catch(err) {};
}

if(!FOR) {var FOR = {};}
  

FOR.fh = {
	
	init : function(){
	
	this.diaporama();
	this.print();
	this.iti();
	this.promos();
	this.newsletter();
	},
	
	diaporama : function(){
		try{
			var img = new Image();
			for (i=1;i<9;i++){
				img.src = "/imagerie/fichehotel/for/diaporama_0"+i+".jpg"; //preload
				var bt = $("bt_mini0"+i);
				if (bt){ 
					bt.observe('mouseover',function(){this.setStyle({"backgroundPosition":"0 bottom"});$("focus").src= "/imagerie/fichehotel/for/diaporama_"+this.id.substr(7,2)+".jpg";return false;});
  				bt.observe('mouseout',function(){this.setStyle({"backgroundPosition":"0 top"});});
  			}
			}
		} catch (ee){
		}
		
	},
	
	print : function(){
		Event.observe("bt_imprimer","click",function(){
			window.print();
			return false;
		});
	
	},
	
	iti : function(){
		Event.observe("titre_itineraire","click",function(ev){
			Event.stop(ev);
			window.open("./map.shtml","pop",'scrollbars=yes,resizable=yes,width=480,height=300');
			return false;
		});
	
	},
	
	promos : function(){
			$$(".pop_promo").each(function(pp){
			
			Event.observe(pp,"click",function(ev){
				Event.stop(ev);
				window.open(pp.readAttribute("href"),'promo','scrollbars=no,resizable=no,width=480,height=300');

				return false;
			});
		});
	},
	
	newsletter : function(){
		$("bt_newsletter").href = '/mailing_list.svlt?action=CREATEACCOUNT&site=FOR|ALL&';
	}
	

}


Event.observe(document,"dom:loaded",function(){
		
		FOR.fh.init();
		
	
});
