        hs.registerOverlay(
        {
                thumbnailId: null,
                overlayId: 'controlbar',
                position: 'top right',
                hideOnMouseOut: true
                }
        );

    hs.graphicsDir = 'js/highslide/graphics/';
    hs.outlineType = 'rounded-white';
    // Tell Highslide to use the thumbnail's title for captions
    hs.captionEval = 'this.thumb.title';



	var initHandler = window.onload;
	window.onload = function() {
	//	initHandler.call();
//   	    setTimeout( resizeInitially, 1000 );
//resizeInitially();
	};
	window.onresize = resizeContent;
	
function resizeInitially() {
//alert('resizeInitially');
	resizeContent();
	document.getElementById( "map" ).style.visibility = "visible";
}

function resizeContent() {
	var height = getWindowHeight();
	var mapElem = document.getElementById("map");
	var map_height = height - calculateOffsetTop(mapElem);
//alert('resizeContent'+map_height);
	mapElem.style.height = document.getElementById("map-left").style.height = map_height + "px";
	document.getElementById("map-top").style.width = mapElem.clientWidth + "px";
//alert(map);
	map.checkResize();

	resizeLeft();
}

function resizeLeft() {
	var height = getWindowHeight();
	var leftElem = document.getElementById( "left_resuls" );
	var left_height = height - calculateOffsetTop(leftElem);
	leftElem.style.height = left_height + "px";
}

function getWindowHeight() {
	return document.body.clientHeight;
}
	

function calculateOffsetTop(element, opt_top) {
	var top = opt_top || null;
	var offset = 0;
	for (var elem = element; elem && elem != opt_top;elem = elem.offsetParent) {
		offset += elem.offsetTop;
	}
	return offset;
}

var hT, sT;

function expand ( idDiv) {
	if ( document.getElementById(idDiv).style.display == '' ) {
		SmoothHide(idDiv, 0); //Плавное скрытие
		document.getElementById(idDiv).style.display = 'none';
	}
	else {
		document.getElementById(idDiv).style.opacity = 0;
		document.getElementById(idDiv).style.filter = 'alpha(opacity=100)';
		document.getElementById(idDiv).style.display = '';

	//	var T = idDiv.replace('_div', '');
		///var L = document.getElementById(T).offsetLeft + document.getElementById(T).offsetWidth;
//		L -= document.getElementById(idDiv).offsetWidth;

	//	document.getElementById(idDiv).style.marginLeft = L + 'px';
		SmoothShow(idDiv, 1); //Плавное открытие
		if (idDiv == 'filter_by') {
			document.getElementById('check_available').value=1;
		}

	}
}


function SmoothShow ( objId, x ) {
	var obj = document.getElementById(objId);
	op = (obj.style.opacity) ? parseFloat(obj.style.opacity) : parseInt(obj.style.filter)/100; 

	if ( op < x ) { 
		clearTimeout(hT);
		op += 0.2; 
		obj.style.opacity = op;
		obj.style.filter = 'alpha(opacity=' + op*100 + ')'; 
		sT = setTimeout('SmoothShow(\'' + objId + '\', ' + x + ')',10); 
	}
} 
	    
function SmoothHide ( objId, x ) { 
	var obj = document.getElementById(objId);
	op = (obj.style.opacity) ? parseFloat(obj.style.opacity) : parseInt(obj.style.filter)/100;

	if ( op > x ) { 
		clearTimeout(sT);
		op -= 0.2;
		obj.style.opacity = op;
		obj.style.filter = 'alpha(opacity=' + op*100 +')';
		hT = setTimeout('SmoothHide(\'' + objId + '\', ' + x + ')',10); 
	}
}

if( window.dosearchHotels ) {
	var searchHandler = dosearchHotels;
	dosearchHotels = function(line,officename,page) {
		checkResults();
		searchHandler.call(this,line,officename,page);
	}
}
