var winHeight, winWidth;
var iWidth = 20, iHeight = 20;
var Nw = 10, Nh = 10;
function OpenDiv(obj, w, h)
{
	winWidth = w;
	winHeight = h;
	$(obj).style.display = 'block';
	if(w > h)
	{
		iHeight = Math.ceil((h - 10) / ((w - 10) / 20));
	}
	else if(w < h)
	{
		iWidth = Math.ceil((w - 10) / ((h - 10) / 20));
	}
	$(obj).style.top = (document.documentElement.clientHeight - 10) / 2 + "px";
	$(obj).style.left = (document.documentElement.clientWidth - 10) / 2 + "px";
	OpenNow(obj);
}

function OpenNow(obj)
{
	Nw += iWidth;
	Nh += iHeight;
	if(winWidth > Nw || winHeight > Nh)
	{
		if(winWidth > Nw)
		{
			$(obj).style.width = Nw + "px";
			$(obj).style.left = (document.documentElement.clientWidth-Nw) / 2 + "px";
		}
		if(winHeight > Nh)
		{
			$(obj).style.height = Nh + "px";
			$(obj).style.top = (document.documentElement.clientHeight-Nh) / 2 + "px"
		}
		window.setTimeout("OpenNow('" + obj + "')", 10)
	}
}
//关闭层
function CloseDiv(obj)
{  
	$(obj).style.display = "none";
}
