DHTML progress bar for glacial rate adding and editing, closes: Bug#1100
[freeside.git] / httemplate / elements / qlib / boxctrl.js
1 /**\r
2  * QLIB 1.0 Box Abstraction\r
3  * Copyright (C) 2002 2003, Quazzle.com Serge Dolgov\r
4  * This program is free software; you can redistribute it and/or\r
5  * modify it under the terms of the GNU General Public License\r
6  * as published by the Free Software Foundation; either version 2\r
7  * of the License, or (at your option) any later version.\r
8  * http://qlib.quazzle.com\r
9  */\r
10 \r
11 function QBoxCtrl_content() {\r
12     with (this) {\r
13         if (res) {\r
14             this.cwidth = width - res.L - res.R - 8;\r
15             this.cheight = height && (height - res.T - res.B - 8);\r
16             var ec = '"><table border="0" cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td>';\r
17             document.write('<table class="qbox" border="0" cellspacing="0" cellpadding="0" width="' +\r
18                 (width - 8) + (height != null ? '" height="' + (height - 8) : '') + '"><tr><td width="' +\r
19                 res.L + '" height="' + res.T + '"><img src="' + res.TL.src + '" border="0" width="' +\r
20                 res.L + '" height="' + res.T + '"></td><td width="' + cwidth + '" height="' + res.T +\r
21                 '" background="' + res.TC.src + ec + '<td width="' + res.R + '" height="' + res.T +\r
22                 '"><img src="' + res.TR.src + '" border="0" width="' + res.R + '" height="' + res.T +\r
23                 '"></td></tr><tr><td width="' + res.L + (cheight != null ? '" height="' + cheight : '') +\r
24                 '" background="' + res.ML.src + ec + '<td width="' + cwidth + '" bgcolor="' + res.bgcolor +\r
25                 (cheight != null ? '" height="' + cheight : '') + (res.bgtile ? '" background="' +\r
26                 res.bgtile.src : '') + '" align="left" valign="top" class="body" unselectable="on">');\r
27                 if (typeof(body) == "function") {\r
28                     this.body();\r
29                 } else {\r
30                     document.write(body);\r
31                 }\r
32             document.write('</td><td width="' + res.R + (cheight != null ? '" height="' + cheight : '') +\r
33                 '" background="' + res.MR.src + ec + '</tr><tr><td width="' + res.L + '" height="' + res.B +\r
34                 '"><img src="' + res.BL.src + '" border="0" width="' + res.L + '" height="' + res.B +\r
35                 '"></td><td width="' + cwidth + '" height="' + res.B + '" background="' + res.BC.src + ec +\r
36                 '<td width="' + res.R + '" height="' + res.B + '"><img src="' + res.BR.src +\r
37                 '" border="0" width="' + res.R + '" height="' + res.B + '"></td></tr></table><br>');\r
38         }\r
39     }\r
40 }\r
41 \r
42 function QBoxCtrl() {\r
43     this.res = false;\r
44     this.body = "&nbsp;";\r
45     this.cwidth = this.cheight = 0;\r
46     this.content = QBoxCtrl_content;\r
47 }\r
48 QBoxCtrl.prototype = new QWndCtrl();\r