function showLightbox(src, wid, hgh, txt){
	
	var top2 = $(window).scrollTop()+(Math.round(($(window).height()-hgh)/2)-120);
	
	//alert(top2);
	
	$("body").append("<div id='podlojka' style='height:" + $(document).height() + "px'></div>");
	$("body").append("<div id='lightbox' style='margin-left:-" + wid/2 + "px;margin-top:" + top2 + "px;'><div class='img'><img src=" + src + " /></div><div id='lightboxInfo'><p></p><a></a></div></div>");
	$("body div#lightbox").animate({opacity: "1"}, "slow");
	$("body div#podlojka").click(function(){
		hideLightBox();
	});
	$("body div#lightboxInfo a").width(wid + "px");
	$("body div#lightboxInfo a").click(function(){
		hideLightBox();
	});
	$("body div.img img").click(function(){
		hideLightBox();
	});
	$("body div#lightboxInfo p").width(wid + "px");
	$("body div#lightboxInfo p").html(txt);
}
function hideLightBox(){
	$("body div#podlojka").remove();	
	$("body div#lightbox").remove();
}
function hideLightBox_room(){
	$("body div#podlojka").remove();	
	$("body div#lightbox_room").remove();
}

function showLightbox2(path){
	$("body").append("<div id='podlojka' style='height:" + $(document).height() + "px'></div>");
	$("body").append("<div id='lightbox' style='margin-left:-480px;margin-top:" + ($(window).scrollTop()-70) + "px;'><img src='/_i/close.gif' class='close' /><div class='img'><iframe frameborder='0' scrolling='no' src='" + path + "' style='width:960px;height:650px;'></iframe></div></div>");
	$("body div#lightboxInfo a").width("920px");
	$("body div#lightbox").animate({opacity: "1"}, "slow");
	$("body div#podlojka").click(function(){
		hideLightBox();
	});
	$("body div#lightboxInfo").css("padding-top", "10px");
	$("body div#lightboxInfo a").click(function(){
		hideLightBox();
	});
	$("img.close").click(function(){
		hideLightBox();
	});
}

function showLightbox3(id){
	
	var wid = 680;
	var hgh = 300;
	
	var title_curobj = document.getElementById("title_room_"+ id);
	if (!title_curobj) {
		return false;
	}
	var curobj = document.getElementById("room_" + id);
	var curobj2 = document.getElementById("room2_" + id);
	var scheme_curobj = document.getElementById("scheme_room_" + id);
	var text_curobj = document.getElementById("text_room_"+ id);
	
	if (curobj) {
		html_curobj = "<img style=\"margin:5px;border:5px double white;\" src='" + curobj.src + "'>";
	} else {
		html_curobj = '';
	}
	
	if (curobj2) {
		html_curobj2 = "<img style=\"margin:5px;border:5px double white;\" src='" + curobj2.src + "'>";
	} else {
		html_curobj2 = '';
	}
	
	if (scheme_curobj) {
		html_scheme_curobj = "<img style=\"margin:5px;border:5px double white;\" src='" + scheme_curobj.src + "'>";
	} else {
		html_scheme_curobj = '';
	}
	
	var top2 = $(window).scrollTop()+(Math.round(($(window).height()-hgh)/2)-70);
	
	if(!document.getElementById("podlojka")){
		$("body").append("<div id='podlojka' onclick='hideLightBox_room();' style='height:" + $(document).height() + "px'></div>");
	}
	
	if(!document.getElementById("lightbox_room")){
		$("body").append("<div id='lightbox_room' onclick='hideLightBox_room();' style='margin-left:-" + wid/2 + "px;margin-top:" + top2 + "px;'>" + "<div class='img' style='width:" + wid + "px;height:" + hgh + "px;text-align:center;'>" + "<div class=\"title\" style=\"margin:10px;text-align:center;\">" + title_curobj.innerHTML + "</div>" + html_curobj + html_curobj2 + html_scheme_curobj + "<br><div style=\"margin:10px;\">" + text_curobj.innerHTML + "</div>" + "</div></div>");
		$("body div#lightbox_room").animate({opacity: "1"}, "slow");
	}
	/*
	$("body div#podlojka").click(function(){
		hideLightBox_room();
	});
	$("body div#lightbox_room").click(function(){
		hideLightBox_room();
	});
	*/
}
