
<!--
/*FileName:AlertMsg.js
title:提示标题
content:提示的内容*/
document.write("<style type=\"text/css\">*{padding:0; margin:0}.close{float:right;cursor:pointer;}.tclass{float:left;}</style>");
var msgw=0;
var msgh=0;
var sHeight=0;
var sWidth=0;
function $(id){ return document.getElementById(id)}
function AlertMsg(title,content,width,height)
{
/*var msgw,msgh,msgbg,msgcolor,bordercolor,titlecolor,titlebg; */
var msgbg,msgcolor,bordercolor,titlecolor,titlebg; 
//弹出窗口设置
msgw = width;   //窗口宽度 
msgh = height-30;   //窗口高度 
msgbg = "#FFF";    //内容背景
msgcolor = "#000";   //内容颜色
bordercolor = "#000"; //边框颜色 
titlecolor = "#FFFFFF"; //标题颜色
/*titlebg = "#369";   //标题背景*/
titlebg = "url(/bsdt/image/xiwei_top.gif)";   //标题背景-*
//遮罩背景设置 
/*var sWidth,sHeight; */
if(document.body.scrollHeight>document.body.clientHeight)
{ sHeight = document.body.scrollHeight;}
else
{ sHeight = document.body.clientHeight;}

sWidth = document.body.clientWidth;

//创建遮罩背景 
var maskObj = document.createElement("div"); 
maskObj.setAttribute('id','maskdiv'); 
maskObj.style.position = "absolute"; 
maskObj.style.top = "0"; 
maskObj.style.left = "0"; 
/*maskObj.style.background = "#777"; */
maskObj.style.background = "#000"; 
maskObj.style.filter = "Alpha(opacity=30);"; 
maskObj.style.opacity = "0.3"; 
maskObj.style.width = sWidth + "px"; 
maskObj.style.height = sHeight + "px"; 
maskObj.style.zIndex = "10000"; 
document.body.appendChild(maskObj); 
/*var select_num = document.getElementsByTagName("select").length;
for(s_n = 0;s_n < select_num ;s_n++)
{
	document.getElementsByTagName("select")[s_n].style.display="none";
}*/

//创建弹出窗口
var msgObj = document.createElement("div") 
msgObj.setAttribute("id","msgdiv"); 
msgObj.style.position ="absolute";

//取窗口滚动条高度
function getScrollTop()
{
var scrollTop=0;
if(document.documentElement&&document.documentElement.scrollTop)
{
scrollTop=document.documentElement.scrollTop;
}
else if(document.body)
{
scrollTop=document.body.scrollTop;
}
return scrollTop;
}

msgObj.style.top = ((screen.availHeight - msgh) / 4 + getScrollTop()) + "px";
msgObj.style.left = (screen.availWidth - msgw) / 2 + "px";
msgObj.style.width = msgw + "px";
msgObj.style.height = msgh + "px";
msgObj.style.fontSize = "12px";
msgObj.style.background = msgbg;
msgObj.style.border = "1px solid " + bordercolor; 
msgObj.style.zIndex = "10001"; 
//创建标题
var thObj = document.createElement("div");
thObj.setAttribute("id","msgth"); 
thObj.className = "DragAble";
/*thObj.title = "按住鼠标左键可以拖动窗口！";*/
thObj.style.cursor = "move";
/*thObj.style.height = "20px";*/
thObj.style.padding = "2px 6px";
thObj.style.color = titlecolor;
thObj.style.background = titlebg;
var titleStr = "<div style='height:20px;line-height:20px;'><a class='close'  title='关闭' onclick='CloseMsg()'><font color='"+titlecolor+"'>关闭</font></a>"+"<span class='tclass'>"+ title +"</span></div>";
thObj.innerHTML = titleStr;
//创建内容
var bodyObj = document.createElement("div");
bodyObj.setAttribute("id","msgbody"); 
/*bodyObj.style.padding = "10px";
bodyObj.style.lineHeight = "1.5em";*/
bodyObj.style.padding = "0px";
bodyObj.style.margin = "0px";
bodyObj.style.lineHeight = "1.5em";

/*var txt = document.createTextNode(content)*/
/*bodyObj.appendChild(txt);*/
var txt = "<div align='center' style='background:#FFFFFF'><iframe name=ifcontent id=ifcontent  width='"+(msgw-0)+"' height='"+msgh+"'  src='"+content+"' frameborder='0' scrolling='no' marginwidth='0' marginheight='0'></iframe></div>";
bodyObj.innerHTML = txt;

/*bodyObj.innerHTML = "11111111";*/

//生成窗口
document.body.appendChild(msgObj);
$("msgdiv").appendChild(thObj);
$("msgdiv").appendChild(bodyObj);
}
function CloseMsg(){
//移除对象
document.body.removeChild($("maskdiv")); 
$("msgdiv").removeChild($("msgth")); 
$("msgdiv").removeChild($("msgbody")); 
document.body.removeChild($("msgdiv")); 
}
//拖动窗口
var ie = document.all;   
var nn6 = document.getElementById&&!document.all;   
var isdrag = false;   
var y,x;   
var oDragObj;   

/*msgw = 350;   //窗口宽度 
msgh = 200;   //窗口高度 */

/*var sHeight=0;
var sWidth=0;*/

function moveMouse(e) {   
if (isdrag) {

var y_top =  nTY + event.clientY - y;
var x_left = nTX + event.clientX - x;
var x_jg = 5; /* X误差 */
var y_jg = 25;/* Y误差 */

if(y_top>sHeight-msgh-y_jg)
{
  y_top = sHeight-msgh-y_jg;
}
if(y_top<0)
{y_top=0}

if(x_left> sWidth - msgw-x_jg)
{
  x_left =  sWidth - msgw-x_jg;
}
if(x_left<0)
{x_left=0}

if(nn6==true)
{
var tt_top = nTY + e.clientY - y;
var tt_left= nTX + e.clientX - x;

if(tt_top<0)
{tt_top=0}

if(tt_top>sHeight-msgh-y_jg)
{
tt_top = sHeight-msgh-y_jg;
}

if(tt_left < 0)
{tt_left=0}

if(tt_left > sWidth - msgw-x_jg)
{tt_left = sWidth - msgw-x_jg}
}



/*if()
{}*/

oDragObj.style.top = (nn6 ?  tt_top : y_top)+"px";
oDragObj.style.left = (nn6 ? tt_left : x_left )+"px";
return false;
}
}


function initDrag(e) {
var oDragHandle = nn6 ? e.target : event.srcElement;   
var topElement = "HTML";   
while (oDragHandle.tagName != topElement && oDragHandle.className != "DragAble") {   
oDragHandle = nn6 ? oDragHandle.parentNode : oDragHandle.parentElement;   
}   
if (oDragHandle.className=="DragAble") {   
isdrag = true;
oDragObj = oDragHandle.parentNode;
nTY = parseInt(oDragObj.style.top);
y = nn6 ? e.clientY : event.clientY;
nTX = parseInt(oDragObj.style.left);
x = nn6 ? e.clientX : event.clientX;
document.onmousemove = moveMouse;
return false;
}
}
document.onmousedown = initDrag;
document.onmouseup = new Function("isdrag=false");
//--> 


