﻿//提示对话框
function WebAlert(str, icon) {
    
    var sWidth, sHeight;
    //sWidth=document.body.offsetWidth; //得出当前屏幕的宽
    sWidth = document.body.clientWidth; //BODY对象宽度

    //sHeight=screen.height;//得到当前屏幕的高
    //sHeight=document.body.clientHeight;//BODY对象高度
    if (window.innerHeight && window.scrollMaxY) {
        sHeight = window.innerHeight + window.scrollMaxY;
    }
    else if (document.body.scrollHeight > document.body.offsetHeight) {
        sHeight = document.body.scrollHeight;
    }
    else {
        sHeight = document.body.offsetHeight;
    } //以上得到整个屏幕的高

    var shimObj = document.getElementById("Mask2");
    shimObj.style.display = "";
    shimObj.style.width = sWidth + "px";
    shimObj.style.height = sHeight + "px";

    var maskObj = document.getElementById("Mask");
    maskObj.style.display = "";
    maskObj.style.width = sWidth + "px";
    maskObj.style.height = sHeight + "px";

    var msgObj = document.getElementById("MsgDivs");
    msgObj.style.display = "";
    //msgObj.style.position = "absolute"; //绝对定位
    //msgObj.style.left = "35%"; //从左侧开始位置
    //msgObj.style.top = "30%"; //从上部开始位置
    //msgObj.style.zIndex = "1000"; //层的z轴位置
    //alert(str + "/" + icon);
    var img = document.getElementById("icon");
    if (icon == "ok") {
        img.src = "../image/web/icon_ok.gif";
    }
    if (icon == "no") {
        img.src = "../image/web/icon_no.gif";
        
    }

    var txt = document.getElementById("msgtxt");
    txt.innerHTML = str; //把传进来的值赋给p属性
}
