 
                    
                
         
    
    
    
   
   
   
   
   
	
    
        
        
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <HTML>
<HTML>
 <HEAD>
<HEAD>
 <TITLE> New Document </TITLE>
<TITLE> New Document </TITLE>
 </HEAD>
</HEAD>

 <BODY>
<BODY>
 <form action="#">
<form action="#">
 <input name=btn1 type=button value=有自定义按钮 onclick=showalert1();>
<input name=btn1 type=button value=有自定义按钮 onclick=showalert1();>
 <input name=btn2 type=button value=无自定义按钮 onclick=showalert2();>
<input name=btn2 type=button value=无自定义按钮 onclick=showalert2();>
 </form>
</form>

 <script language="javascript">
<script language="javascript">
 <!--
<!--

 function gourl(e)
    function gourl(e) {
{

 switch(e)
        switch(e) {
{
 case 1:
            case 1:
 window.alert("点击了确定按钮.");
                window.alert("点击了确定按钮.");
 break;
                break;
 case 2:
            case 2:
 break;
                break;
 case 3:
            case 3:
 window.alert("点击了其它按钮.");
                window.alert("点击了其它按钮.");
 break;
                break;
 default:
            default:
 break;
                break;
 }
        }
 }
    }


 function showalert1()
    function showalert1() {
{
 var Br = new innerMessageBox();
        var Br = new innerMessageBox();
 Br.ShowModal("示例", "您确定要删除该项吗?", 320, 120, "gourl($)", "重试");
        Br.ShowModal("示例", "您确定要删除该项吗?", 320, 120, "gourl($)", "重试");
 }
    }


 function showalert2()
    function showalert2() {
{
 var Br = new innerMessageBox();
        var Br = new innerMessageBox();
 Br.ShowModal("示例", "您确定要删除该项吗?", 320, 120, "gourl($)");
        Br.ShowModal("示例", "您确定要删除该项吗?", 320, 120, "gourl($)");
 }
    }
 //-->
//-->
 </script>
</script>

 <script>
<script>
 <!--
<!--

 function innerMessageBox()
    function innerMessageBox() {
{
 var BackObject, FormObject;
        var BackObject, FormObject;

 //    检查页面中是否存在该控件.
        //    检查页面中是否存在该控件.

 function checkIMBObject()
        function checkIMBObject() {
{

 if (document.getElementById("imb_Background")==null)
            if (document.getElementById("imb_Background")==null) {
{
 document.body.innerHTML += "<iframe id=\"imb_Background\" src=\"about:blank\" style=\"position:absolute;left:0;top:0;width:0px;height:0px;visibility:hidden;\" frameborder=\"0\"></iframe>";
                document.body.innerHTML += "<iframe id=\"imb_Background\" src=\"about:blank\" style=\"position:absolute;left:0;top:0;width:0px;height:0px;visibility:hidden;\" frameborder=\"0\"></iframe>";
 window.imb_Background.document.open();
                window.imb_Background.document.open();
 window.imb_Background.document.write("<html><body bgcolor=red> sdfasdfasdf</body></html>");
                window.imb_Background.document.write("<html><body bgcolor=red> sdfasdfasdf</body></html>");
 window.imb_Background.document.close();
                window.imb_Background.document.close();
 }
            }

 if (document.getElementById("imb_FormModal")==null)
            if (document.getElementById("imb_FormModal")==null) {
{
 document.body.innerHTML += "<iframe id=\"imb_FormModal\" src=\"about:blank\" style=\"position:absolute;left:0;top:0;width:0px;height:0px;visibility:hidden;border-bottom:3px solid #999999;border-right:3px solid #999999;border-top:1px solid #F8F6C1;border-left:1px solid #F8F6C1;\" frameborder=\"0\"></iframe>";
                document.body.innerHTML += "<iframe id=\"imb_FormModal\" src=\"about:blank\" style=\"position:absolute;left:0;top:0;width:0px;height:0px;visibility:hidden;border-bottom:3px solid #999999;border-right:3px solid #999999;border-top:1px solid #F8F6C1;border-left:1px solid #F8F6C1;\" frameborder=\"0\"></iframe>";
 window.imb_FormModal.document.open();
                window.imb_FormModal.document.open();
 window.imb_FormModal.document.write("<html><head><style><!--");
                window.imb_FormModal.document.write("<html><head><style><!--");
 window.imb_FormModal.document.write("td{font-size:12px;");
                window.imb_FormModal.document.write("td{font-size:12px;");
 window.imb_FormModal.document.write("//--></style></head><body scroll=no leftmargin=0 topmargin=0>");
                window.imb_FormModal.document.write("//--></style></head><body scroll=no leftmargin=0 topmargin=0>");
 window.imb_FormModal.document.write("<table width=100% height=100% bgcolor=\"#F6F8DF\"><tr><td  align=left bgcolor=#EDE808><div id=\"imb_Title\" style=\"padding-left:3px;padding-right:3px;\">");
                window.imb_FormModal.document.write("<table width=100% height=100% bgcolor=\"#F6F8DF\"><tr><td  align=left bgcolor=#EDE808><div id=\"imb_Title\" style=\"padding-left:3px;padding-right:3px;\">");
 window.imb_FormModal.document.write("</div></td></tr><tr><td align=left><div id=\"imb_Content\" style=\"padding:7px;\">");
                window.imb_FormModal.document.write("</div></td></tr><tr><td align=left><div id=\"imb_Content\" style=\"padding:7px;\">");
 window.imb_FormModal.document.write("</div></td></tr><tr><td id=\"imb_Body\" align=center>");
                window.imb_FormModal.document.write("</div></td></tr><tr><td id=\"imb_Body\" align=center>");
 window.imb_FormModal.document.write("</td></tr></table>");
                window.imb_FormModal.document.write("</td></tr></table>");
 window.imb_FormModal.document.write("</body></html>");
                window.imb_FormModal.document.write("</body></html>");
 window.imb_FormModal.document.close();
                window.imb_FormModal.document.close();
 }
            }
 }
        }

 //    显示对话框控件.
        //    显示对话框控件.

 this.ShowModal = function(iCaption, iMessage, iWidth, iHeight, iClickFunc, iOther)
        this.ShowModal = function(iCaption, iMessage, iWidth, iHeight, iClickFunc, iOther) {
{
 var smWidth = 420, smHeight = 180, smCaption = "默认对话框", smMessage="您确定执行这项操作吗?", smFunc, smObject, smAlpha, smInterval;
            var smWidth = 420, smHeight = 180, smCaption = "默认对话框", smMessage="您确定执行这项操作吗?", smFunc, smObject, smAlpha, smInterval;

 if (arguments.length > 4 )
            if (arguments.length > 4 ) {
{
 smWidth = iWidth;
                smWidth = iWidth;
 smHeight = iHeight;
                smHeight = iHeight;
 smCaption = iCaption;
                smCaption = iCaption;
 smMessage = iMessage;
                smMessage = iMessage;
 smFunc = iClickFunc;
                smFunc = iClickFunc;
 }
            }
 //    背景的渐显.
            //    背景的渐显.

 function checkIMBAlpha()
            function checkIMBAlpha() {
{
 smObject.style.filter = "alpha(opacity="+smAlpha+");";
                smObject.style.filter = "alpha(opacity="+smAlpha+");";
 smAlpha += 10;
                smAlpha += 10;

 if (smAlpha>80)
                if (smAlpha>80) {
{
 clearInterval(smInterval);
                    clearInterval(smInterval);
 }
                }
 }
            }
 checkIMBObject();
            checkIMBObject();
 this.BackObject = document.getElementById("imb_Background");
            this.BackObject = document.getElementById("imb_Background");
 this.FormObject = document.getElementById("imb_FormModal");
            this.FormObject = document.getElementById("imb_FormModal");
 smObject = this.BackObject;
            smObject = this.BackObject;
 smAlpha = 0;
            smAlpha = 0;
 this.BackObject.style.left = 0;
            this.BackObject.style.left = 0;
 this.BackObject.style.top = 0;
            this.BackObject.style.top = 0;
 this.BackObject.style.width = document.body.scrollWidth;
            this.BackObject.style.width = document.body.scrollWidth;
 this.BackObject.style.height = document.body.scrollHeight;
            this.BackObject.style.height = document.body.scrollHeight;
 this.BackObject.style.visibility = "visible";
            this.BackObject.style.visibility = "visible";
 smInterval = window.setInterval(checkIMBAlpha, 5);
            smInterval = window.setInterval(checkIMBAlpha, 5);

 this.FormObject.style.left = document.body.clientWidth/2 - smWidth/2;
            this.FormObject.style.left = document.body.clientWidth/2 - smWidth/2;
 this.FormObject.style.top = document.body.clientHeight/2 - smHeight/2;
            this.FormObject.style.top = document.body.clientHeight/2 - smHeight/2;
 this.FormObject.style.width = smWidth;
            this.FormObject.style.width = smWidth;
 this.FormObject.style.height = smHeight;
            this.FormObject.style.height = smHeight;
 this.FormObject.style.visibility = "visible";
            this.FormObject.style.visibility = "visible";
 window.imb_FormModal.document.getElementById("imb_Title").innerHTML = "<b>" + smCaption + "</b>" + " -- 操作提示";
            window.imb_FormModal.document.getElementById("imb_Title").innerHTML = "<b>" + smCaption + "</b>" + " -- 操作提示";
 window.imb_FormModal.document.getElementById("imb_Content").innerHTML = smMessage;
            window.imb_FormModal.document.getElementById("imb_Content").innerHTML = smMessage;

 if (iOther==null || iOther=="")
            if (iOther==null || iOther=="") {
{
 window.imb_FormModal.document.getElementById("imb_Body").innerHTML = "<input type=hidden id=imb_Other name=imb_Other shortKey=\"O\">   <input type=submit id=imb_Ok name=imb_Ok value=\"确定\" shortKey=\"T\">   <input type=button id=imb_Cancel name=imb_Cancel value=\"取消\" shortKey=\"C\">";
                window.imb_FormModal.document.getElementById("imb_Body").innerHTML = "<input type=hidden id=imb_Other name=imb_Other shortKey=\"O\">   <input type=submit id=imb_Ok name=imb_Ok value=\"确定\" shortKey=\"T\">   <input type=button id=imb_Cancel name=imb_Cancel value=\"取消\" shortKey=\"C\">";

 }else
            }else {
{
 window.imb_FormModal.document.getElementById("imb_Body").innerHTML = "<input type=button id=imb_Other name=imb_Other value="+iOther+" shortKey=\"O\">   <input type=submit id=imb_Ok name=imb_Ok value=\"确定\" shortKey=\"T\">   <input type=button id=imb_Cancel name=imb_Cancel value=\"取消\" shortKey=\"C\">";
                window.imb_FormModal.document.getElementById("imb_Body").innerHTML = "<input type=button id=imb_Other name=imb_Other value="+iOther+" shortKey=\"O\">   <input type=submit id=imb_Ok name=imb_Ok value=\"确定\" shortKey=\"T\">   <input type=button id=imb_Cancel name=imb_Cancel value=\"取消\" shortKey=\"C\">";
 }
            }
 document.body.disabled = true;
            document.body.disabled = true;

 window.imb_FormModal.document.getElementById("imb_Ok").onclick= function()
            window.imb_FormModal.document.getElementById("imb_Ok").onclick= function() {
{
 parent.document.body.disabled = false;
                parent.document.body.disabled = false;

 if (smFunc!=null && smFunc!="")
                if (smFunc!=null && smFunc!="") {
{
 eval("parent." + smFunc.replace("$","1"));
                    eval("parent." + smFunc.replace("$","1"));
 }
                }
 parent.document.getElementById("imb_Background").style.visibility = "hidden";
                parent.document.getElementById("imb_Background").style.visibility = "hidden";
 parent.document.getElementById("imb_FormModal").style.visibility = "hidden";
                parent.document.getElementById("imb_FormModal").style.visibility = "hidden";
 }
            }

 window.imb_FormModal.document.getElementById("imb_Cancel").onclick= function()
            window.imb_FormModal.document.getElementById("imb_Cancel").onclick= function() {
{

 if (smFunc!=null && smFunc!="")
                if (smFunc!=null && smFunc!="") {
{
 eval("parent." + smFunc.replace("$","2"));
                    eval("parent." + smFunc.replace("$","2"));
 }
                }
 parent.document.body.disabled = false;
                parent.document.body.disabled = false;
 parent.document.getElementById("imb_Background").style.visibility = "hidden";
                parent.document.getElementById("imb_Background").style.visibility = "hidden";
 parent.document.getElementById("imb_FormModal").style.visibility = "hidden";
                parent.document.getElementById("imb_FormModal").style.visibility = "hidden";
 }
            }

 window.imb_FormModal.document.getElementById("imb_Other").onclick= function()
            window.imb_FormModal.document.getElementById("imb_Other").onclick= function() {
{

 if (smFunc!=null && smFunc!="")
                if (smFunc!=null && smFunc!="") {
{
 eval("parent." + smFunc.replace("$","3"));
                    eval("parent." + smFunc.replace("$","3"));
 }
                }
 parent.document.body.disabled = false;
                parent.document.body.disabled = false;
 parent.document.getElementById("imb_Background").style.visibility = "hidden";
                parent.document.getElementById("imb_Background").style.visibility = "hidden";
 parent.document.getElementById("imb_FormModal").style.visibility = "hidden";
                parent.document.getElementById("imb_FormModal").style.visibility = "hidden";
 }
            }
 }
        }
 }
    }
 //-->
//-->
 </script>
</script>
 </BODY>
</BODY>
 </HTML>
</HTML>


 
        posted on 
2007-02-07 10:08 
mbskys 
阅读(
148) 
评论() 
 
收藏 
举报