﻿function AlterDivAndClose(alertDivId, buttonOpenID, buttonCloseID) {
    alert("");
    var radDivName = 'ZheZhao' + (parseInt(Math.random() * (10000 - 1000 + 1) + 10000)); //随机ID
    $('body').append("<div  id='" + radDivName + "'></div>"); //遮罩DIV 
    radDivName = "#" + radDivName;
    $(alertDivId).css({position: "absolute"});
    $(alertDivId).css({ left: 0, top: 0, "z-index": "1249", "display": "none" }); //层的样式 
    $(radDivName).css({position: "absolute", "background-color": "#aaa", "display": "none", "z-index": "1238", top: 0, left: 0, opacity: 0.7});
    //开***********************
    $(buttonOpenID).click(function() {
        //****弹出层的高和宽
        //****网页所有可用区的高宽
        var ScreenW = $(document).width(); //网页所有可用区宽
        var ScreenH = $(document).height();   //网页所有可用区高
        var divWidth = $(alertDivId).outerWidth()
        var divHeight = $(alertDivId).outerHeight();
        //****获取LEFT,TOP
        var v_left = (document.body.clientWidth - divWidth) / 2; //LEFT
        var v_top = (document.body.clientHeight - divHeight) / 2; //TOP 
        $(radDivName).css({  width: document.body.clientWidth, height: document.body.clientHeight });
        $(alertDivId).css({top:v_top, left: v_left});
        $(alertDivId).fadeIn("slow");
        $(radDivName).fadeIn("slow");
    });
    //关***********************
    $(buttonCloseID).click(function() {
       $(alertDivId).fadeOut("slow");
        $(radDivName).fadeOut("slow");
    });
    $(radDivName).click(function() {
       $(alertDivId).fadeOut("slow");
        $(radDivName).fadeOut("slow");
    });
}
//        var posX;
//        var posY;
//        var fdiv;
//        function Move_Open(){
//        fdiv = document.getElementById("Open_file_sele");
//        document.getElementById("HelpTitle").onmousedown = function(e) {
//            if (!e) e = window.event;  //如果是IE
//            posX = e.clientX - parseInt(fdiv.style.left);
//            posY = e.clientY - parseInt(fdiv.style.top);
//            document.onmousemove = mousemove;
//        }

//        document.onmouseup = function() {
//            document.onmousemove = null;
//        }
//        }
//        function mousemove(ev) {
//            if (ev == null) ev = window.event; //如果是IE
//            fdiv.style.left = (ev.clientX - posX) + "px";
//            fdiv.style.top = (ev.clientY - posY) + "px";
//        }

