//获取滚动条离顶部位置
function GetScrollTop()
{
	var scrollTop; 
	if (typeof window.pageYOffset != 'undefined') { 
	   scrollTop = window.pageYOffset; 
	} 
	else if (typeof document.compatMode != 'undefined' && 
		 document.compatMode != 'BackCompat') { 
	   scrollTop = document.documentElement.scrollTop; 
	} 
	else if (typeof document.body != 'undefined') { 
	   scrollTop = document.body.scrollTop; 
	}
	return scrollTop;
}

//获取滚动条离左边位置
function GetScrollLeft()
{
	var scrollLeft; 
	if (typeof window.pageYOffset != 'undefined') { 
	   scrollLeft = window.pageYOffset; 
	} 
	else if (typeof document.compatMode != 'undefined' && 
		 document.compatMode != 'BackCompat') { 
	   scrollLeft = document.documentElement.scrollLeft; 
	} 
	else if (typeof document.body != 'undefined') { 
	   scrollLeft = document.body.scrollLeft; 
	}
	return scrollLeft;
}

//获取body的客户可视高度
function GetClientHeight()
{
	var clientHeight; 
	if (typeof window.pageYOffset != 'undefined') { 
	   clientPos = window.pageYOffset; 
	} 
	else if (typeof document.compatMode != 'undefined' && 
		 document.compatMode != 'BackCompat') { 
	   clientHeight = document.documentElement.clientHeight; 
	} 
	else if (typeof document.body != 'undefined') { 
	   clientHeight = document.body.clientHeight; 
	}
	return clientHeight;
}

//获取body的客户可视宽度
function GetClientWidth()
{
	var clientWidth; 
	if (typeof window.pageYOffset != 'undefined') { 
	   clientPos = window.pageYOffset; 
	} 
	else if (typeof document.compatMode != 'undefined' && 
		 document.compatMode != 'BackCompat') { 
	   clientWidth = document.documentElement.clientWidth; 
	} 
	else if (typeof document.body != 'undefined') { 
	   clientWidth = document.body.clientWidth; 
	}
	return clientWidth;
}


//显示弹出窗口
function ShowOpenWin(DivName,DivWidth,DivHeight)
{   var ScrollTop=GetScrollTop();      //获取滚动条离顶部位置
	var ClientHeight=GetClientHeight();//获取body的客户可视高度
	var ScrollLeft=GetScrollLeft();    //获取滚动条离左边位置
	var ClientWidth=GetClientWidth();  //获取body的客户可视宽度
	document.getElementById(DivName).style.display="block";
	document.getElementById(DivName).style.width=DivWidth+"px";
	document.getElementById(DivName).style.top=((ClientHeight-DivHeight)/2)+ScrollTop;
	document.getElementById(DivName).style.left=((ClientWidth-DivWidth)/2)+ScrollLeft;
}