A dialog box is a commonly used tool for displaying information on webpages. Therefore, I have implemented a small dialog box myself. Dialog = {
Createdialog: function (content, newid ){
Mask ();
VaR dialogbox = Document. createelement ('div ');
Dialogbox. innerhtml = content;
If (! Ctit. Utility. isnull (newid )){
Dialogbox. ID = newid;
} Else {
Dialogbox. ID = "_ dialogbox __";
}
VaR width = 300;
VaR Height = 500;
VaR left = parseint (ctit. Utility. getviewwidth ()-width)/2 + document.doc umentelement. scrollleft );
VaR Top = parseint(document.doc umentelement. clientheight-height)/2 + document.doc umentelement. scrolltop );
Element. setstyle (dialogbox, {position: "absolute", zindex: 1010, left: Left + "PX", top: Top + "PX", width: parseint (width) + "PX", height: parseint (height) + "PX "});
Dialogbox. style. backgroundcolor = "# fff ";
Document. Body. appendchild (dialogbox );
Dialog. Keepon (dialogbox. ID );
Return dialogbox;
},
Resetwidthheight: function (ID, width, height ){
VaR o = $ (ID );
O. setstyle ({width: parseint (width) + "PX", height: parseint (height) + "PX "});
},
Fixedwh: function (ID ){
VaR o = $ (ID );
VaR width = 333;
VaR Height = 555;
O. setstyle ({width: parseint (width) + "PX", height: parseint (height) + "PX "});
},
Keepon: function (ID ){
VaR o = $ (ID );
VaR width = element. getwidth (O );
VaR Height = element. getheight (O );
VaR left = parseint (ctit. Utility. getviewwidth ()-width)/2 + document.doc umentelement. scrollleft );
VaR Top = parseint(document.doc umentelement. clientheight-height)/2 + document.doc umentelement. scrolltop );
O. setstyle ({left: Left + "PX", top: Top + "PX "});
Cleartimeout (dialog. Timing );
Dialog. Timing = setTimeout ("dialog. Keepon ('" + O. ID + "');", 300 );
},
Removedialog: function (ID ){
VaR o = $ (ID );
Cleartimeout (dialog. Timing );
Document. Body. removechild (O );
Unmask ();
}
}