[903] | 1 | /****************************************************************************\ |
---|
| 2 | * Dynamic JS Win - Javascript Object * |
---|
| 3 | * * |
---|
| 4 | * Written by: * |
---|
| 5 | * - Raphael Derosso Pereira <raphaelpereira@users.sourceforge.net> * |
---|
| 6 | * ------------------------------------------------------------------------ * |
---|
| 7 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 8 | * under the terms of the GNU General Public License as published by the * |
---|
| 9 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 10 | * option) any later version. * |
---|
| 11 | \****************************************************************************/ |
---|
| 12 | |
---|
| 13 | if (!window.__DEFINE_DJSWIN__) |
---|
| 14 | { |
---|
| 15 | __DEFINE_DJSWIN__ = true; |
---|
| 16 | |
---|
| 17 | if (document.all) |
---|
| 18 | { |
---|
| 19 | navigator.userAgent.toLowerCase().indexOf('msie 5') != -1 ? is_ie5 = true : is_ie5 = false; |
---|
| 20 | is_ie = true; |
---|
| 21 | is_moz1_6 = false; |
---|
| 22 | is_mozilla = false; |
---|
| 23 | is_ns4 = false; |
---|
| 24 | } |
---|
| 25 | else if (document.getElementById) |
---|
| 26 | { |
---|
| 27 | navigator.userAgent.toLowerCase().match('mozilla.*rv[:]1\.6.*gecko') ? is_moz1_6 = true : is_moz1_6 = false; |
---|
| 28 | is_ie = false; |
---|
| 29 | is_ie5 = false; |
---|
| 30 | is_mozilla = true; |
---|
| 31 | is_ns4 = false; |
---|
| 32 | } |
---|
| 33 | else if (document.layers) |
---|
| 34 | { |
---|
| 35 | is_ie = false; |
---|
| 36 | is_ie5 = false; |
---|
| 37 | is_moz1_6 = false; |
---|
| 38 | is_mozilla = false; |
---|
| 39 | is_ns4 = true; |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | if (!window.dd) |
---|
| 43 | { |
---|
| 44 | throw("wz_dragdrop lib must be loaded!"); |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | function dJSWin(params) |
---|
| 48 | { |
---|
| 49 | if (!params || typeof(params) != 'object' || !params.id || !params.width || !params.height || !params.content_id) |
---|
| 50 | { |
---|
| 51 | throw("Can't create empty window or window without width, height or ID"); |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | /* Internal Variables */ |
---|
| 55 | if (is_ie) |
---|
| 56 | { |
---|
| 57 | this.winContainer = document.createElement('iframe'); |
---|
| 58 | } |
---|
| 59 | this.clientArea = document.createElement('div'); |
---|
| 60 | this.title = document.createElement('div'); |
---|
| 61 | this.title_text = document.createElement('span'); |
---|
| 62 | this.buttons = new Array(); |
---|
| 63 | this.button_ext = ""; |
---|
| 64 | this.state = ""; |
---|
| 65 | this.shadows = new Array(); |
---|
| 66 | this.border = new Array(); |
---|
| 67 | this.content = _dJSWinElement(params.content_id); |
---|
| 68 | this.includedContents = params['include_contents']; |
---|
| 69 | var _this = this; |
---|
| 70 | |
---|
| 71 | if (is_moz1_6) |
---|
| 72 | { |
---|
| 73 | var content_ = this.content; |
---|
| 74 | this.content = this.content.cloneNode(true); |
---|
| 75 | |
---|
| 76 | content_.id = content_.id+'CLONE'; |
---|
| 77 | content_.style.display = 'none'; |
---|
| 78 | } |
---|
| 79 | |
---|
| 80 | this.border['t'] = document.createElement('div'); |
---|
| 81 | this.border['b'] = document.createElement('div'); |
---|
| 82 | this.border['l'] = document.createElement('div'); |
---|
| 83 | this.border['r'] = document.createElement('div'); |
---|
| 84 | |
---|
| 85 | this.shadows['r'] = document.createElement('div'); |
---|
| 86 | this.shadows['b'] = document.createElement('div'); |
---|
| 87 | |
---|
| 88 | this.buttons['xDIV'] = document.createElement('div'); |
---|
| 89 | |
---|
| 90 | if (params['button_x_img']) |
---|
| 91 | { |
---|
| 92 | this.buttons['xIMG'] = document.createElement('IMG'); |
---|
| 93 | this.buttons['xIMG'].src = params['button_x_img']; |
---|
| 94 | this.buttons['xIMG'].style.cursor = 'hand'; |
---|
| 95 | this.buttons['xDIV'].appendChild(this.buttons['xIMG']); |
---|
| 96 | } |
---|
| 97 | else |
---|
| 98 | { |
---|
| 99 | this.buttons.xDIV.innerHTML = 'X'; |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | if (params['button_y_img']) |
---|
| 103 | { |
---|
| 104 | var _this = this; |
---|
| 105 | |
---|
| 106 | this.button_ext = document.createElement('IMG'); |
---|
| 107 | this.button_ext.id = 'button_ext'; |
---|
| 108 | this.button_ext.src = params['button_y_img']; |
---|
| 109 | this.button_ext.style.position = 'absolute'; |
---|
| 110 | this.button_ext.style.cursor = 'pointer'; |
---|
| 111 | this.button_ext.style.top = '1px'; |
---|
| 112 | this.button_ext.style.left = parseInt(params['width']) - 28 + 'px'; |
---|
| 113 | this.button_ext.style.zIndex = '1'; |
---|
| 114 | this.button_ext.onclick = function(){_this.hide(); _this.state = 1;}; |
---|
| 115 | } |
---|
| 116 | |
---|
| 117 | /* Inicialization */ |
---|
| 118 | this.title.id = params['id']; |
---|
| 119 | this.title.style.position = 'absolute'; |
---|
| 120 | this.title.style.visibility = 'hidden'; |
---|
| 121 | this.title.style.width = parseInt(params['width']) + 2 + 'px'; |
---|
| 122 | this.title.style.height = params['title_height'] ? params['title_height'] : '18px'; |
---|
| 123 | this.title.style.backgroundColor = params['title_color']; |
---|
| 124 | this.title.style.top = '0px'; |
---|
| 125 | this.title.style.left = '0px'; |
---|
| 126 | this.title.style.zIndex = '1'; |
---|
| 127 | |
---|
| 128 | this.title_text.style.position = 'relative'; |
---|
| 129 | this.title_text.className = params['title_class']; |
---|
| 130 | this.title_text.style.fontWeight = 'bold'; |
---|
| 131 | this.title_text.style.color = params['title_text_color'] ? params['title_text_color'] : 'black'; |
---|
| 132 | // this.title_text.style.cursor = 'move'; |
---|
| 133 | this.title_text.innerHTML = params['title']; |
---|
| 134 | this.title_text.style.zIndex = '1'; |
---|
| 135 | |
---|
| 136 | if (is_ie) |
---|
| 137 | { |
---|
| 138 | this.winContainer.id = params['id']+'_winContainer'; |
---|
| 139 | this.winContainer.style.position = 'absolute'; |
---|
| 140 | this.winContainer.style.visibility = 'hidden'; |
---|
| 141 | this.winContainer.style.width = params['width']; |
---|
| 142 | //this.winContainer.style.height = parseInt(params['height']) + parseInt(this.title.style.height) + 'px'; |
---|
| 143 | this.winContainer.style.height = params['height']; |
---|
| 144 | // this.winContainer.style.top = '0px'; |
---|
| 145 | this.winContainer.style.top = this.title.style.height; |
---|
| 146 | this.winContainer.style.left = '0px'; |
---|
| 147 | this.winContainer.style.zIndex = '-1'; |
---|
| 148 | // this.winContainer.style.backgroundColor = params['bg_color']; |
---|
| 149 | // this.winContainer.className = params['win_class']; |
---|
| 150 | this.winContainer.src = ''; |
---|
| 151 | } |
---|
| 152 | |
---|
| 153 | this.clientArea.id = params['id']+'_clientArea'; |
---|
| 154 | this.clientArea.style.position = 'absolute'; |
---|
| 155 | this.clientArea.style.visibility = 'hidden'; |
---|
| 156 | this.clientArea.style.width = parseInt(params['width']) + 2 + 'px'; |
---|
| 157 | this.clientArea.style.height = params['height']; |
---|
| 158 | this.clientArea.style.top = parseInt(this.title.style.height) + 'px'; |
---|
| 159 | this.clientArea.style.left = '0px'; |
---|
| 160 | this.clientArea.style.backgroundColor = params['bg_color']; |
---|
| 161 | // this.clientArea.style.overflow = 'auto'; |
---|
| 162 | this.clientArea.className = params['win_class']; |
---|
| 163 | |
---|
| 164 | this.buttons.xDIV.id = params['id']+'_button'; |
---|
| 165 | this.buttons.xDIV.style.position = 'absolute'; |
---|
| 166 | this.buttons.xDIV.style.visibility = 'hidden'; |
---|
| 167 | this.buttons.xDIV.style.cursor = 'hand'; |
---|
| 168 | this.buttons.xDIV.style.top = '1px'; |
---|
| 169 | this.buttons.xDIV.style.left = parseInt(params['width']) - 13 + 'px'; |
---|
| 170 | this.buttons.xDIV.style.zIndex = '1'; |
---|
| 171 | this.buttons.xDIV.onclick = function() {_this.close(); _this.state = 2;}; |
---|
| 172 | |
---|
| 173 | this.content.style.visibility = 'hidden'; |
---|
| 174 | //this.content.style.top = parseInt(this.title.style.height) + 'px'; |
---|
| 175 | this.content.style.top = '0px'; |
---|
| 176 | this.content.style.left = '0px'; |
---|
| 177 | |
---|
| 178 | this.shadows.b.id = params['id']+'_shadowb'; |
---|
| 179 | this.shadows.b.style.position = 'absolute'; |
---|
| 180 | this.shadows.b.style.visibility = 'hidden'; |
---|
| 181 | this.shadows.b.style.backgroundColor = '#666'; |
---|
| 182 | this.shadows.b.style.width = params['width']; |
---|
| 183 | this.shadows.b.style.height = '4px'; |
---|
| 184 | this.shadows.b.style.top = parseInt(this.title.style.height) + parseInt(params['height']) + 'px'; |
---|
| 185 | this.shadows.b.style.left = '4px'; |
---|
| 186 | |
---|
| 187 | this.shadows.r.id = params['id']+'_shadowr'; |
---|
| 188 | this.shadows.r.style.position = 'absolute'; |
---|
| 189 | this.shadows.r.style.visibility = 'hidden'; |
---|
| 190 | this.shadows.r.style.backgroundColor = '#666'; |
---|
| 191 | this.shadows.r.style.width = '4px'; |
---|
| 192 | this.shadows.r.style.height = parseInt(params['height']) + parseInt(this.title.style.height) + 'px'; |
---|
| 193 | this.shadows.r.style.top = '4px'; |
---|
| 194 | this.shadows.r.style.left = params['width']; |
---|
| 195 | |
---|
| 196 | this.border.t.id = params['id']+'_border_t'; |
---|
| 197 | this.border.b.id = params['id']+'_border_b'; |
---|
| 198 | this.border.l.id = params['id']+'_border_l'; |
---|
| 199 | this.border.r.id = params['id']+'_border_r'; |
---|
| 200 | |
---|
| 201 | this.border.t.style.position = 'absolute'; |
---|
| 202 | this.border.b.style.position = 'absolute'; |
---|
| 203 | this.border.l.style.position = 'absolute'; |
---|
| 204 | this.border.r.style.position = 'absolute'; |
---|
| 205 | |
---|
| 206 | this.border.t.style.visibility = 'hidden'; |
---|
| 207 | this.border.b.style.visibility = 'hidden'; |
---|
| 208 | this.border.l.style.visibility = 'hidden'; |
---|
| 209 | this.border.r.style.visibility = 'hidden'; |
---|
| 210 | |
---|
| 211 | this.border.t.style.backgroundColor = params['title_color']; |
---|
| 212 | this.border.b.style.backgroundColor = params['title_color']; |
---|
| 213 | this.border.l.style.backgroundColor = params['title_color']; |
---|
| 214 | this.border.r.style.backgroundColor = params['title_color']; |
---|
| 215 | |
---|
| 216 | this.border.t.className = params['title_class']; |
---|
| 217 | this.border.b.className = params['title_class']; |
---|
| 218 | this.border.l.className = params['title_class']; |
---|
| 219 | this.border.r.className = params['title_class']; |
---|
| 220 | |
---|
| 221 | this.border.t.style.border = '0px'; |
---|
| 222 | this.border.b.style.border = '0px'; |
---|
| 223 | this.border.l.style.border = '0px'; |
---|
| 224 | this.border.r.style.border = '0px'; |
---|
| 225 | |
---|
| 226 | if (params['border']) |
---|
| 227 | { |
---|
| 228 | this.border.t.style.width = parseInt(params['width']) + 2 + 'px'; |
---|
| 229 | this.border.b.style.width = parseInt(params['width']) + 2 + 'px'; |
---|
| 230 | this.border.l.style.width = '2px'; |
---|
| 231 | this.border.r.style.width = '2px'; |
---|
| 232 | |
---|
| 233 | if (is_ie) |
---|
| 234 | { |
---|
| 235 | this.border.t.style.height = '0'; |
---|
| 236 | this.border.b.style.height = '0'; |
---|
| 237 | this.border.l.style.height = parseInt(params['height']) + parseInt(this.title.style.height) + 2 + 'px'; |
---|
| 238 | this.border.r.style.height = parseInt(params['height']) + parseInt(this.title.style.height) + 2 + 'px'; |
---|
| 239 | |
---|
| 240 | this.border.t.style.top = '0'; |
---|
| 241 | this.border.b.style.top = parseInt(params['height']) + parseInt(this.title.style.height) + 'px'; |
---|
| 242 | this.border.l.style.top = '0'; |
---|
| 243 | this.border.r.style.top = '0'; |
---|
| 244 | } |
---|
| 245 | else |
---|
| 246 | { |
---|
| 247 | this.border.t.style.height = '2px'; |
---|
| 248 | this.border.b.style.height = '2px'; |
---|
| 249 | this.border.l.style.height = parseInt(params['height']) + parseInt(this.title.style.height) + 4 + 'px'; |
---|
| 250 | this.border.r.style.height = parseInt(params['height']) + parseInt(this.title.style.height) + 4 + 'px'; |
---|
| 251 | |
---|
| 252 | this.border.t.style.top = '-2px'; |
---|
| 253 | this.border.b.style.top = parseInt(params['height']) + parseInt(this.title.style.height) + 'px'; |
---|
| 254 | this.border.l.style.top = '-2px'; |
---|
| 255 | this.border.r.style.top = '-2px'; |
---|
| 256 | } |
---|
| 257 | |
---|
| 258 | this.border.t.style.left = '-2px'; |
---|
| 259 | this.border.b.style.left = '-2px'; |
---|
| 260 | this.border.l.style.left = '-2px'; |
---|
| 261 | this.border.r.style.left = params['width']; |
---|
| 262 | |
---|
| 263 | //this.winContainer.style.width = parseInt(this.winContainer.style.width) + 4 + 'px'; |
---|
| 264 | //this.winContainer.style.height = parseInt(this.winContainer.style.height) + 4 + 'px'; |
---|
| 265 | //this.clientArea.style.width = parseInt(this.clientArea.style.width) + 4 + 'px'; |
---|
| 266 | //this.clientArea.style.height = parseInt(this.clientArea.style.height) + 4 + 'px'; |
---|
| 267 | |
---|
| 268 | //this.title.style.top = parseInt(this.title.style.top) + 2 + 'px'; |
---|
| 269 | //this.clientArea.style.top = parseInt(this.clientArea.style.top) + 2 + 'px'; |
---|
| 270 | //this.buttons.xDIV.style.top = parseInt(this.buttons.xDIV.style.top) + 2 + 'px'; |
---|
| 271 | this.shadows.b.style.top = parseInt(this.shadows.b.style.top) + 2 + 'px'; |
---|
| 272 | this.shadows.r.style.top = parseInt(this.shadows.r.style.top) + 2 + 'px'; |
---|
| 273 | //this.content.style.top = parseInt(this.content.style.top) + 2 + 'px'; |
---|
| 274 | |
---|
| 275 | //this.title.style.left = parseInt(this.title.style.left) + 2 + 'px'; |
---|
| 276 | //this.clientArea.style.left = parseInt(this.clientArea.style.left) + 2 + 'px'; |
---|
| 277 | //this.buttons.xDIV.style.left = parseInt(this.buttons.xDIV.style.left) + 2 + 'px'; |
---|
| 278 | this.shadows.b.style.left = parseInt(this.shadows.b.style.left) + 2 + 'px'; |
---|
| 279 | this.shadows.r.style.left = parseInt(this.shadows.r.style.left) + 2 + 'px'; |
---|
| 280 | //this.content.style.left = '2px'; |
---|
| 281 | } |
---|
| 282 | else |
---|
| 283 | { |
---|
| 284 | this.border.t.style.width = '0px'; |
---|
| 285 | this.border.b.style.width = '0px'; |
---|
| 286 | this.border.l.style.width = '0px'; |
---|
| 287 | this.border.r.style.width = '0px'; |
---|
| 288 | } |
---|
| 289 | |
---|
| 290 | if (!is_moz1_6) |
---|
| 291 | { |
---|
| 292 | this.content.parentNode.removeChild(this.content); |
---|
| 293 | } |
---|
| 294 | /* |
---|
| 295 | this.winContainer.appendChild(this.title); |
---|
| 296 | this.winContainer.appendChild(this.buttons.xDIV); |
---|
| 297 | this.winContainer.appendChild(this.border.t); |
---|
| 298 | this.winContainer.appendChild(this.border.b); |
---|
| 299 | this.winContainer.appendChild(this.border.l); |
---|
| 300 | this.winContainer.appendChild(this.border.r); |
---|
| 301 | this.winContainer.appendChild(this.shadows.r); |
---|
| 302 | this.winContainer.appendChild(this.shadows.b); |
---|
| 303 | this.winContainer.appendChild(this.content); |
---|
| 304 | */ |
---|
| 305 | if (is_ie) |
---|
| 306 | { |
---|
| 307 | this.title.appendChild(this.winContainer); |
---|
| 308 | } |
---|
| 309 | else |
---|
| 310 | { |
---|
| 311 | this.title.appendChild(this.border.t); |
---|
| 312 | } |
---|
| 313 | this.title.appendChild(this.title_text); |
---|
| 314 | this.title.appendChild(this.clientArea); |
---|
| 315 | this.title.appendChild(this.buttons.xDIV); |
---|
| 316 | if(this.button_ext){this.title.appendChild(this.button_ext);}; |
---|
| 317 | this.title.appendChild(this.border.b); |
---|
| 318 | this.title.appendChild(this.border.l); |
---|
| 319 | this.title.appendChild(this.border.r); |
---|
| 320 | this.title.appendChild(this.shadows.r); |
---|
| 321 | this.title.appendChild(this.shadows.b); |
---|
| 322 | this.clientArea.appendChild(this.content); |
---|
| 323 | |
---|
| 324 | document.body.appendChild(this.title); |
---|
| 325 | |
---|
| 326 | } |
---|
| 327 | |
---|
| 328 | dJSWin.prototype.close = function() |
---|
| 329 | { |
---|
| 330 | var _this = this; |
---|
| 331 | _this.state = 0; |
---|
| 332 | dd.elements[this.title.id].hide(); |
---|
| 333 | }; |
---|
| 334 | |
---|
| 335 | dJSWin.prototype.open = function() |
---|
| 336 | { |
---|
| 337 | /* if (is_ie) |
---|
| 338 | { |
---|
| 339 | this.moveTo(document.body.offsetWidth/2 - dd.elements[this.title.id].w/2, |
---|
| 340 | document.body.offsetHeight/2 - dd.elements[this.winContainer.id].h/2); |
---|
| 341 | } |
---|
| 342 | else |
---|
| 343 | { |
---|
| 344 | this.moveTo(window.innerWidth/2 - dd.elements[this.title.id].w/2, |
---|
| 345 | window.innerHeight/2 - dd.elements[this.clientArea.id].h/2); |
---|
| 346 | } |
---|
| 347 | */ |
---|
| 348 | if (is_ie) |
---|
| 349 | { |
---|
| 350 | this.moveTo(document.body.offsetWidth/2 + document.body.scrollLeft - dd.elements[this.title.id].w/2, |
---|
| 351 | document.body.offsetHeight/2 + document.body.scrollTop - dd.elements[this.winContainer.id].h/2); |
---|
| 352 | } |
---|
| 353 | else |
---|
| 354 | { |
---|
| 355 | this.moveTo(window.innerWidth/2 + window.pageXOffset - dd.elements[this.title.id].w/2, |
---|
| 356 | window.innerHeight/2 + window.pageYOffset - dd.elements[this.clientArea.id].h/2); |
---|
| 357 | } |
---|
| 358 | |
---|
| 359 | dd.elements[this.title.id].maximizeZ(); |
---|
| 360 | dd.elements[this.title.id].show(); |
---|
| 361 | }; |
---|
| 362 | |
---|
| 363 | dJSWin.prototype.show = function() |
---|
| 364 | { |
---|
| 365 | this.open(); |
---|
| 366 | }; |
---|
| 367 | |
---|
| 368 | dJSWin.prototype.hide = function() |
---|
| 369 | { |
---|
| 370 | this.close(); |
---|
| 371 | }; |
---|
| 372 | |
---|
| 373 | dJSWin.prototype.moveTo = function(x,y) |
---|
| 374 | { |
---|
| 375 | dd.elements[this.title.id].moveTo(x,y); |
---|
| 376 | }; |
---|
| 377 | |
---|
| 378 | dJSWin.prototype.x = function() |
---|
| 379 | { |
---|
| 380 | return dd.elements[this.title.id].x; |
---|
| 381 | }; |
---|
| 382 | |
---|
| 383 | dJSWin.prototype.y = function() |
---|
| 384 | { |
---|
| 385 | return dd.elements[this.title.id].y; |
---|
| 386 | }; |
---|
| 387 | |
---|
| 388 | dJSWin.prototype.draw = function() |
---|
| 389 | { |
---|
| 390 | if (dd.elements && dd.elements[this.title.id]) |
---|
| 391 | { |
---|
| 392 | return; |
---|
| 393 | } |
---|
| 394 | |
---|
| 395 | if (is_ie) |
---|
| 396 | { |
---|
| 397 | ADD_DHTML(this.winContainer.id+NO_DRAG); |
---|
| 398 | } |
---|
| 399 | else |
---|
| 400 | { |
---|
| 401 | ADD_DHTML(this.border.t.id+NO_DRAG); |
---|
| 402 | } |
---|
| 403 | ADD_DHTML(this.title.id+CURSOR_MOVE); |
---|
| 404 | ADD_DHTML(this.clientArea.id+NO_DRAG); |
---|
| 405 | ADD_DHTML(this.buttons.xDIV.id+NO_DRAG); |
---|
| 406 | ADD_DHTML(this.content.id+NO_DRAG); |
---|
| 407 | ADD_DHTML(this.shadows.r.id+NO_DRAG); |
---|
| 408 | ADD_DHTML(this.shadows.b.id+NO_DRAG); |
---|
| 409 | ADD_DHTML(this.border.b.id+NO_DRAG); |
---|
| 410 | ADD_DHTML(this.border.l.id+NO_DRAG); |
---|
| 411 | ADD_DHTML(this.border.r.id+NO_DRAG); |
---|
| 412 | |
---|
| 413 | if (is_ie) |
---|
| 414 | { |
---|
| 415 | dd.elements[this.title.id].addChild(dd.elements[this.winContainer.id]); |
---|
| 416 | } |
---|
| 417 | else |
---|
| 418 | { |
---|
| 419 | dd.elements[this.title.id].addChild(dd.elements[this.border.t.id]); |
---|
| 420 | } |
---|
| 421 | //dd.elements[this.title.id].setZ(dd.elements[this.border.t.id].z+1); |
---|
| 422 | //dd.elements[this.title.id].maximizeZ(); |
---|
| 423 | |
---|
| 424 | dd.elements[this.title.id].addChild(dd.elements[this.clientArea.id]); |
---|
| 425 | dd.elements[this.title.id].addChild(dd.elements[this.buttons.xDIV.id]); |
---|
| 426 | dd.elements[this.title.id].addChild(dd.elements[this.content.id]); |
---|
| 427 | dd.elements[this.title.id].addChild(dd.elements[this.shadows.r.id]); |
---|
| 428 | dd.elements[this.title.id].addChild(dd.elements[this.shadows.b.id]); |
---|
| 429 | dd.elements[this.title.id].addChild(dd.elements[this.border.b.id]); |
---|
| 430 | dd.elements[this.title.id].addChild(dd.elements[this.border.l.id]); |
---|
| 431 | dd.elements[this.title.id].addChild(dd.elements[this.border.r.id]); |
---|
| 432 | |
---|
| 433 | |
---|
| 434 | if (typeof(this.includedContents) == 'object') |
---|
| 435 | { |
---|
| 436 | for (var i in this.includedContents) |
---|
| 437 | { |
---|
| 438 | ADD_DHTML(this.includedContents[i]+NO_DRAG); |
---|
| 439 | dd.elements[this.title.id].addChild(dd.elements[this.includedContents[i]]); |
---|
| 440 | } |
---|
| 441 | } |
---|
| 442 | |
---|
| 443 | // dd.elements[this.title.id].setZ('-1'); |
---|
| 444 | |
---|
| 445 | if (is_ie) |
---|
| 446 | { |
---|
| 447 | dd.elements[this.title.id].moveTo(document.body.offsetWidth/2 - dd.elements[this.winContainer.id].w/2, |
---|
| 448 | document.body.offsetHeight/2 - dd.elements[this.winContainer.id].h/2) |
---|
| 449 | } |
---|
| 450 | else |
---|
| 451 | { |
---|
| 452 | dd.elements[this.title.id].moveTo(window.innerWidth/2 - dd.elements[this.clientArea.id].w/2, |
---|
| 453 | window.innerHeight/2 - dd.elements[this.clientArea.id].h/2); |
---|
| 454 | } |
---|
| 455 | |
---|
| 456 | dd.elements[this.title.id].hide(); |
---|
| 457 | }; |
---|
| 458 | |
---|
| 459 | function _dJSWinElement(id) |
---|
| 460 | { |
---|
| 461 | if (document.getElementById) |
---|
| 462 | { |
---|
| 463 | return document.getElementById(id); |
---|
| 464 | } |
---|
| 465 | else if (document.all) |
---|
| 466 | { |
---|
| 467 | return document.all[id]; |
---|
| 468 | } |
---|
| 469 | else |
---|
| 470 | { |
---|
| 471 | throw("Browser Not Supported!"); |
---|
| 472 | } |
---|
| 473 | } |
---|
| 474 | |
---|
| 475 | if (!dd.elements) |
---|
| 476 | { |
---|
| 477 | var div = document.createElement('div'); |
---|
| 478 | div.id = '__NONE__#'; |
---|
| 479 | div.style.position = 'absolute'; |
---|
| 480 | |
---|
| 481 | SET_DHTML(div.id); |
---|
| 482 | } |
---|
| 483 | } |
---|