if(typeof ch == "undefined"){
	var ch = {};
}
if(!ch.bravofly){
	ch.bravofly= {};
}
if(!ch.bravofly.hotel){
	ch.bravofly.hotel = {};
}
;(function(){
	var Search = Class.create({
			initialize: function(ctorArgs){
				this.appendTrackingImg("takeover");
			},
			appendTrackingImg: function(param){
				var url = window.location.toString();
				if(!url){ return }
				var res = new RegExp(param + "=([^&]+)").exec(url);
				// Add a node if the parameter is found
				if(res && res[1]){
					var img = document.createElement("img");
					img.src = "http://adlev.neodatagroup.com/ad/srtg.jsp?ac=1&c="+res[1];
					img.width  = 1;
					img.height = 1;
					img.border = 0;
					document.body.appendChild(img);
				}
			},
			legacyInit: function(){
				// old global code
				bodyOnLoad();
				Tooltip && Tooltip.init();
			},
			runDeferreds: function(){
				this.legacyInit();
			}
		})
	;
	Event.observe(document, 'dom:loaded',
		function(){
			ch.bravofly.hotel.search = new Search();
		}
	);
	Event.observe(document, 'onload',
		function(){
			ch.bravofly.hotel.search.runDeferreds();
		}
	);
})();
