Gallery = {
	show: function(src)
		{
			this.loading();
			if(document.getElementById('ContLogin'))
				NoLogin();
			//alert(document.body.clientHeight + ' ' + document.body.scrollHeight + ' ' + document.body.offsetHeight + ' ' + document.body.scrollTop + ' ' + screen.height);
			var d = document.createElement("div");
			d.setAttribute("id", "MaskBody");
			d.className = "MaskBody";
			d.style.height = document.body.scrollHeight + "px";
			d.style.width = document.body.scrollWidth + "px";

			document.body.appendChild(d);

			var c = document.createElement("div");
			c.setAttribute("id", "ContLogin");
			c.className = "LoginBlock";
			//c.style.display = "none";
			c.style.width = "90%";
			c.style.height = "600px";
			c.style.left = "40px";
			c.style.right = "40px";
			//c.style.top = document.body.clientHeight / 2 - 100;
			c.style.top = "100px";
			document.body.appendChild(c);

			var text = '<table cellpadding="0" cellspacing="0" border="0" style="border: solid 1px #a568c4;" width="100%" onclick="Gallery.close();" style="cursor: pointer;">';
			text += '<tr><td style="background-image: url(/img/top_2.gif); background-repeat: repeat-x; height: 26px;" valign="middle">';
			text += '</td></tr><tr bgcolor="#bfa7cb">';
			text += '<td align="center" width="900" height="600"><img src="/data/' + src + '" border="0" alt="" onclick="Gallery.close();" style="cursor: pointer;"/></td></tr></table>';

			var con = document.getElementById("ContLogin");
			con.innerHTML = text;
			this.endloading();
		},
	close: function()
		{
			if(document.getElementById("ContLogin"))
			{
				var c = document.getElementById("ContLogin");
				document.body.removeChild(c);
			}
			if(document.getElementById("MaskBody"))
			{
				var d = document.getElementById("MaskBody");
				document.body.removeChild(d);
			}
		},
	loading: function()
		{
			if(document.getElementById('Loading'))
				this.endloading();
			var d = document.createElement("div");
			d.setAttribute("id", "Loading");
			d.className = "Loading";
			d.style.left = document.body.scrollWidth / 2 - 130 + "px";
			d.style.top = document.body.scrollTop + (document.body.clientHeight / 2) + "px";

			var text = document.createTextNode("Загрузка...");
			d.appendChild(text);

			document.body.appendChild(d);
			document.body.style.cursor = "wait";
		},
	endloading: function()
		{
			var d = document.getElementById("Loading");
			document.body.removeChild(d);
			document.body.style.cursor = "default";
		}
}