var docEle = function(_id) 
{
    return document.getElementById(arguments[0]) || false;
}


function openNewDiv(_id) 
{
	var _top = 10;
	if (_id == 'login')
	{
		_top = 100;
	}

	if (_id == 'l-rzrq')
	{
		_top = 200;
	}

    var m = "mask";

    if (docEle(m)){
		var obj = document.getElementById(m);
		obj.parentNode.removeChild(obj);
	}

    //mask遮罩层
    var newMask = document.createElement("div");
    newMask.id = m;
    newMask.style.position = "absolute";
    newMask.style.zIndex = "11";
    _scrollWidth = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth);
    _scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
    newMask.style.width = _scrollWidth + "px";
    newMask.style.height = _scrollHeight + "px";
    newMask.style.top = "0px";
    newMask.style.left = "0px";
    newMask.style.background = "#33393C";
    newMask.style.filter = "alpha(opacity=80)";
    newMask.style.opacity = "0.80";
    document.body.appendChild(newMask);
    
    //新弹出层
	var newDiv = document.getElementById(_id);
	var documentTop = document.documentElement.scrollTop|| document.body.scrollTop;
    newDiv.style.position = "absolute";
    newDiv.style.zIndex = "12";
    newDivWidth = 500;
    newDivHeight = 200;
    newDiv.style.top = (documentTop + _top) + "px";
    newDiv.style.left = (document.body.scrollLeft + document.body.clientWidth/2 - newDivWidth/2) + "px";
	newDiv.style.display = '';

    //弹出层滚动居中
//    function newDivCenter()
//    {
//		var documentTop = document.documentElement.scrollTop|| document.body.scrollTop;
//		newDiv.style.top = (documentTop + _top) + "px";
//        newDiv.style.left = (document.body.scrollLeft + document.body.clientWidth/2 - newDivWidth/2) + "px";
//    }
//    if(document.all)
//    {
//        window.attachEvent("onscroll",newDivCenter);
//    }
//    else
//    {
//        window.addEventListener('scroll',newDivCenter,false);
//    }
}
function closeDiv(_id){
		var cfm = confirm("确认关闭吗？");
		if(cfm)
		{
			document.getElementById(_id).style.display = 'none';
			jQuery('#mask').remove();
			return true;
		}else{
			return false;
		}
}

function closeOi(_id){
	jQuery("#tbl_Order span").text("");
	document.getElementById(_id).style.display = 'none';
	jQuery('#mask').remove();
	return true;
}