/* COOKIES */

var Cookies = {
	init: function () {
		var allCookies = document.cookie.split('; ');
		for (var i=0;i<allCookies.length;i++) {
			var cookiePair = allCookies[i].split('=');
			this[cookiePair[0]] = cookiePair[1];
		}
	},
	create: function (name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
		this[name] = value;
	},
	erase: function (name) {
		this.create(name,'',-1);
		this[name] = undefined;
	}
};
Cookies.init();

var cbswbe_lastheight;
function timedResizeIFrame() {
	var re = new RegExp("\#\\d+\\+\\d+\$");
	var m = re.exec(window.location.hash)
		if (m != null) {
 			var s = "";
	    for (i = 0; i < m.length; i++) {
	      s = s + m[i] + "\n";
	    }
	  	var h = parseInt(s.substring(1).split("+")[0]) + 10;
	  	if (h) 
	  		if (cbswbe_lastheight != h) {
	  			document.getElementById("cbs_wbe").style.height = h+'px';
						cbswbe_lastheight = h;
				}
		} 
	t=setTimeout("timedResizeIFrame()",360);
	}
	var x = Cookies['wcbs_profile_id'];
	var wcbs_ihst = "http://infomatic.clockbs.com/wbe/subs/DIAMANTI/hotels/254/sessions/new"+(window.location.search?(window.location.search+"&"):"?")+"wcbs_ihst="+escape(window.location.href+(x?("&wcbs_profile_id="+x):""))+"";
document.write("<iframe name='cbs_wbe' frameborder='0' id='cbs_wbe' width='100%' scrolling='no' src='"+wcbs_ihst+"'></iframe>");
timedResizeIFrame();
