// JavaScript Document
/**
* 功能:显示提示窗口
* 使用方法提示:
* <script src="popAlert.js" language="javascript"></script>
* <button onClick="showPop('今天天气真好呀')">test</button>
*/
/**
* 描述:显示提示层
*/
var ifm=null;
function showPop(info){
if(ifm==null){
ifm=document.createElement("<iframe allowTransparency='true' id='popframe' frameborder=0 marginheight=0 src='about:blank' marginwidth=0 hspace=0 vspace=0 scrolling=no></iframe>")
ifm.style.width=screen.availWidth;
ifm.style.height=screen.availHeight;
ifm.style.position="absolute";
ifm.style.left=0;
ifm.style.top=0;
ifm.name=ifm.uniqueID;
document.body.appendChild(ifm);
}else{
ifm.style.visibility="visible";
}
var win=window.frames[ifm.name];
win.document.write("<body leftmargin=0 topmargin=0 οncοntextmenu='self.event.returnValue=false'><div id=popbg></div><div id=popbody></div></body>");
win.document.body.style.backgroundColor="transparent";
document.body.style.overflow="hidden";
var pBody=win.document.body.children[1];
var pBg=win.document.body.children[0];
hideAllSelect();
initBg(pBg);
initBody(pBody,info);
}
/**
* 描述:初始化背景层
*/
function initBg(obj){
with(obj.style){
position="absolute";
left="0";
top="0";
width="100%";
height="100%";
visibility="hidden";
backgroundColor="#000000";
filter="blendTrans(duration=2) alpha(opacity=50)";
}
if (obj.filters.blendTrans.status != 2) {//no playing
obj.filters.blendTrans.apply();
obj.style.visibility="visible";
obj.filters.blendTrans.play();
}
}
/**
* 描述:初始化显示层
*/
function initBody(obj,info){
with(obj.style){
position="absolute";
width="400";
height="150";
backgroundColor="#ffffff";
}
obj.style.left=window.document.body.clientWidth/2-200;
obj.style.top=window.document.body.clientHeight/3;
var str;
str="<table border=0 cellpadding=0 cellspacing=1 bgcolor=#000000 width=100% height=100%><tr height=20>";
str+="<td align=center style='color:#000000;font-size:14px;font-weight:bold' bgcolor=#9999ff>...:::提示:::...</td></tr>";
str+="<tr><td align=center bgcolor=#efefff style='font-size:12px;color:#000000;vertical-align: bottom;'>";
str+=info+"<br><br><button οnclick='parent.closeWin()'>确定</button><br><br></td></tr></table>";
obj.innerHTML=str;
}
/**
* 描述:关闭一切
*/
function closeWin(){
ifm.style.visibility="hidden";
showAllSelect();
document.body.style.overflow="auto";
}
function hideAllSelect(){
var obj;
obj=document.getElementsByTagName("SELECT");
var i;
for(i=0;i<obj.length;i++)
obj[i].style.visibility="hidden";
}
function showAllSelect(){
var obj;
obj=document.getElementsByTagName("SELECT");
var i;
for(i=0;i<obj.length;i++)
obj[i].style.visibility="visible";
}