function showalert(str , pic) {
//提示图片
var picUrl = "/pic/et/";
if(pic=="perfect"){
picUrl = picUrl+"perfect.gif";
}else if(pic=="qusition"){
picUrl = picUrl+"qusition.gif";
}else if(pic=="tip"){
picUrl = picUrl+"tip.gif";
}else{
picUrl = picUrl+"error.gif";
}
    //确定遮罩层的高度，宽度
    var h = document.documentElement.scrollHeight+"px";
    var w = document.documentElement.scrollWidth+"px";
    //创建遮罩层，它的主要作用就是使网页中的其他元素不可用。
   var dv = document.createElement("DIV"); 
dv.id = 'Tmask'; 
dv.style.position = "absolute"; 
dv.style.zIndex = "100"; 
dv.style.width = w; 
dv.style.height = h; 
dv.style.top = "0px"; 
dv.style.left = "0px"; 
dv.style.background ='blue'; 
dv.style.filter = "alpha(opacity=10)"; 
dv.style.opacity = "0.10"; 
    //设为绝对定位很重要
    dv.style.position = "absolute";
    //将该元素添加至body中
    document.body.appendChild(dv);
    //获得alert框高度的位置
var BSH=document.documentElement.clientHeight;
var BSHt=document.documentElement.scrollTop;
var winH = 225;
var relTop=(BSH-225)/2 > 0 ? (BSH-225)/2:0;
    var objTop = parseInt(BSHt+relTop)+"px";
     //创建提示对话框面板
    var dvMsg = document.createElement("div");
    dvMsg.style.position = "absolute";
    dvMsg.setAttribute('id','msg');
    dvMsg.style.width = "450px";
    dvMsg.style.height = "130px";
    dvMsg.style.top=objTop;
    dvMsg.style.left="30%";
    dvMsg.style.background = "white";
    dvMsg.style.border="1px solid #6699dd";
    dvMsg.style.zIndex = "1112";
    document.body.appendChild(dvMsg);
    //标题栏
    var title = document.createElement("div");
    title.style.position = "absolute";
    title.setAttribute('id','title');
    title.style.width = "450px";
    title.style.height = "16px";
    title.style.top= "0";   
    title.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=1,opacity=100,finishOpacity=100%)";
    title.style.zIndex = "1113";
    title.innerHTML = "<font size='2'>&nbsp;提&nbsp;示</font>";
    title.style.background = "#6699ff";
    //提示图片
    var imgErr = document.createElement("img");
    imgErr.src = picUrl;
    imgErr.style.marginLeft = "15px";
    imgErr.style.marginTop = "30px";
    imgErr.style.position = "absolute";
    //关闭图片
    var imgClo = document.createElement("img");
    imgClo.src = "/pic/share/close.jpg";
    imgClo.style.marginLeft = "433px";
    imgClo.style.marginTop = "1px";
    imgClo.style.position = "absolute";
    imgClo.style.zIndex = "1115";
    imgClo.style.cursor = "hand";
    imgClo.onclick = function ()
    {
        document.body.removeChild(dv);
        document.body.removeChild(dvMsg);   
    }
    //确定按钮
    var btn = document.createElement("input");
    btn.id = "ok";
    btn.type= "button";
    btn.value = "确  定";
    btn.style.marginTop = "100px";
    btn.style.marginLeft = "43%";
    btn.style.position = "absolute";
    btn.style.border = "1px solid #6699ff";
    btn.style.background = "lightblue";
    //点击关闭
    btn.onclick = function ()
          {
            document.body.removeChild(dv);
            document.body.removeChild(dvMsg);
          }       
    //响应回车     
    btn.onkeydown = function ()
          {
            if (event.keyCode == "13")
            {
                document.body.removeChild(dv);
                document.body.removeChild(dvMsg);
            }
          }
    var msg = document.createElement("div");
    msg.style.marginTop = "30px";
    msg.style.marginLeft = "25%";
    msg.style.position = "absolute";
    msg.style.width = "300px";
    msg.innerHTML = str;
    msg.style.wordWrap = "break-word";
    document.getElementById('msg').appendChild(msg);
    document.getElementById('msg').appendChild(btn);
    document.getElementById('msg').appendChild(imgErr);
    document.getElementById('msg').appendChild(imgClo);
    document.getElementById('msg').appendChild(title);        
    document.getElementById('ok').focus();
}
