		function getScrollXY() {
		  var scrOfX = 0, scrOfY = 0;
		  if( typeof( window.pageYOffset ) == 'number' ) {
		    //Netscape compliant
		    scrOfY = window.pageYOffset;
		    scrOfX = window.pageXOffset;
		  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		    //DOM compliant
		    scrOfY = document.body.scrollTop;
		    scrOfX = document.body.scrollLeft;
		  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 		  {
		    //IE6 standards compliant mode
		    scrOfY = document.documentElement.scrollTop;
		    scrOfX = document.documentElement.scrollLeft;
		  }
		  //return [ scrOfX, scrOfY ];
		  return scrOfY;
		}
	
		function getPageSize()	
		{
			var xScroll, yScroll;
			if (window.innerHeight && window.scrollMaxY) {
			xScroll = window.innerWidth + window.scrollMaxX;
			yScroll = window.innerHeight + window.scrollMaxY;
			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
			}
			var windowWidth, windowHeight;
			if (self.innerHeight) { // all except Explorer
			if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth;
			} else {
			windowWidth = self.innerWidth;
			}
			windowHeight = self.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
			} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
			}
			// for small pages with total height less then height of the viewport
			if(yScroll < windowHeight){
			pageHeight = windowHeight;
			} else {
			pageHeight = yScroll;
			}
			// for small pages with total width less then width of the viewport
			if(xScroll < windowWidth){
			pageWidth = xScroll;
			} else {
			pageWidth = windowWidth;
			}
			return [pageWidth, pageHeight];
		}
		
	var IbsBodyOverflow, IbsBodyHeight;
	
	function hide_Ibs()
	{
		document.body.style.overflow=IbsBodyOverflow;
		document.body.style.height=IbsBodyHeight;
		document.getElementById('Ibs_overlay_div').style.display='none';
		document.getElementById('Ibs_div').style.display='none';
	}
	
	function show_Ibs(config)
	{		
		
		
		
		IbsBodyOverflow=document.body.style.overflow;
		IbsBodyHeight=document.body.style.height;
		
		var actH, actW;
		if (parseInt(navigator.appVersion)>3) {
		 if (navigator.appName=="Netscape") {
		  actW = window.innerWidth;
		  actH = window.innerHeight;
		 }
		 if (navigator.appName.indexOf("Microsoft")!=-1) {
		  actW = document.body.offsetWidth;
		  actH = document.body.offsetHeight;
		 }
		}
		
		if (actW>955 && actH>580)
			document.body.style.overflow = 'hidden';
		
		var size = getPageSize();
		winW = size[0];
		winH = size[1];

		var yyy=getScrollXY();
		document.getElementById('Ibs_div').style.top=(yyy+10)+'px';
		
		document.getElementById('Ibs_overlay_div').style.height=winH+100+'px';
		document.getElementById('Ibs_overlay_div').style.width=winW+'px';
		document.getElementById('Ibs_div').style.left=parseInt((winW-955)/2)<0?0:parseInt((winW-955)/2)+'px';
		document.getElementById('Ibs_overlay_div').style.display='block';
		document.getElementById('Ibs_div').style.display='block';
		
		var Ibs_url_add='/step1';
		if (config.startDate != undefined && config.nights != undefined)
			Ibs_url_add+='/date_start:'+config.startDate+'/nights:'+config.nights;
		if (config.roomId != undefined)
			Ibs_url_add+='/room_id:'+config.roomId;
		
		document.getElementById('Ibs_frame').src=config.h;
		
	}
	
	var IbsPreviousOnload=window.onload;
	function loadIbsDiv() {
	    var div = document.createElement('div');
	    div.id = 'Ibs_main_div';
	    if (document.body.firstChild)
	      document.body.insertBefore(div, document.body.firstChild);
	    else
	      document.body.appendChild(div);
	    
	    div.innerHTML='<div id="Ibs_div" style="position: absolute; display: none; top: 0px; left: 0px; width: 960px; height:577px; z-index: 800005;"><a style="position: absolute; top: 12px; left: 900px;" href="javascript:window.parent.hide_Ibs()"><img src="http://sylwestrowy.pl/images/close.png" border="0" style="margin-left: 25px;"/></a><iframe id="Ibs_frame" name="Ibs_frame" style="width:100%; height:100%; background:transparent; padding: 0px; margin: 0px;" scrolling="no" frameborder="0" transparency="true" allowtransparency="true"></iframe></div><div id="Ibs_overlay_div" style="position: absolute; left: 0px; top: 0px; display: none; z-index: 400000; background:#000; opacity:0.5; filter:alpha(opacity: 50);"></div>';
	 };
	 
	window.onload=function(){if (IbsPreviousOnload) IbsPreviousOnload(); loadIbsDiv();}
