/dev/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/dev/trunk

« back to all changes in this revision

Viewing changes to includes/dhtmlx/dhtmlxmenubar.js

  • Committer: Suren A. Chilingaryan
  • Date: 2008-10-29 03:02:24 UTC
  • Revision ID: csa@dside.dyndns.org-20081029030224-yc3wy2dti4htlfxf
New version of dhtmlxmenu and dhtmlxtree is added

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//v.1.0 build 71114
2
 
 
3
 
/*
4
 
Copyright DHTMLX LTD. http://www.dhtmlx.com
5
 
You allowed to use this component or parts of it under GPL terms
6
 
To use it on other terms or get Professional edition of the component please contact us at sales@dhtmlx.com
7
 
*/
8
 
 
9
 
/*_TOPICS_
10
 
@0:Initialization
11
 
@1:Add/delete
12
 
@2:Action handling
13
 
@3:Private
14
 
@4:Item control
15
 
@5:Private
16
 
*/
17
 
 
18
 
                /**
19
 
          *     @desc: menu object
20
 
          *     @param: width - object width
21
 
          *     @param: height - object height
22
 
          *     @param: name - menu display name
23
 
          *     @param: vMode - if eq 1 => vertical menu bar
24
 
          *     @param: httpsdummy - dummy html page, which will be used for invisible iframes (necessary only for https mode)
25
 
          *     @type: public
26
 
          *     @topic: 0
27
 
          */
28
 
 
29
 
 
30
 
        function dhtmlXMenuBarObject(htmlObject,width,height,name,vMode,gfxPath,httpsdummy){
31
 
                        if (typeof(htmlObject)!="object")
32
 
                        this.parentObject=document.getElementById(htmlObject);
33
 
                else
34
 
                        this.parentObject=htmlObject;
35
 
                if (!this.parentObject) this.parentObject=document.body;
36
 
 
37
 
                this.setGfxPathA=this.setGfxPath;
38
 
                this.setGfxPath=function(){
39
 
                        this.setGfxPathA.apply(this,arguments);
40
 
                        var self=this;
41
 
                        dhtmlXMenuItemObject.prototype.dummyImg=function(){
42
 
                                        return self.sysGfxPath+"blank.gif";
43
 
                        }
44
 
                }
45
 
 
46
 
        if ((_isIE)&&(this.parentObject==document.body))
47
 
                {
48
 
                        var zdiv=document.createElement("DIV");
49
 
                        zdiv.style.position="absolute";
50
 
                        zdiv.style.zIndex=30;
51
 
                        zdiv.style.top=0;
52
 
                        zdiv.style.left=0;
53
 
                        document.body.insertBefore(zdiv,document.body.firstChild);
54
 
            this.parentObject=zdiv;
55
 
                }
56
 
 
57
 
 
58
 
                if (!vMode) this.flsmd=true;
59
 
                this.tname=name;
60
 
                this.topMenu=this;
61
 
                this.width=width;
62
 
                this.height=height;
63
 
                this.topNod=0;
64
 
        this._httpsdummy=httpsdummy;
65
 
                this.ieFix=(document.all?true:false);
66
 
 
67
 
        var detect = navigator.userAgent.toLowerCase();
68
 
        place = detect.indexOf('opera') + 1;
69
 
        if (place)      this.ieFix=false;
70
 
 
71
 
                this.ieWinMode=true;
72
 
                this.ieWinModeState=0;
73
 
                this.zIndex=30;
74
 
                this.maxItems=99;
75
 
                this.echsw=true;
76
 
                this.setGfxPath(gfxPath);
77
 
                this.dividerCell=0;
78
 
                this.firstCell=0;
79
 
                this.nameCell=0;
80
 
                this.crossCell=0;
81
 
                this.echsw2=true;
82
 
                
83
 
                this.tableCSS="menuTable";
84
 
                this.titleCSS="menuName";
85
 
                this.secTableCSS="secondMenuTable";
86
 
                
87
 
                this.extraMode=convertStringToBoolean(vMode);
88
 
                
89
 
                this.defaultAction=0;
90
 
                this.onShow=0;
91
 
                this.onHide=0;
92
 
                
93
 
                var lastOpenedPanel=0;
94
 
                var lastSelectedItem=0;
95
 
                
96
 
                this.items=new Array();
97
 
                this.itemsCount=0;
98
 
                this.gitems=new Array();
99
 
                this.gitemsCount=0;
100
 
                
101
 
                this.subMenus=new Array();
102
 
                this.subMenusCount=0;
103
 
                
104
 
 
105
 
                if (!this.extraMode)
106
 
                        this._createPanel();
107
 
                else
108
 
                        this._createVPanel();
109
 
 
110
 
        
111
 
                this.hiddenForm=document.createElement("FORM");
112
 
                this.hiddenForm.style.display="none";
113
 
        this.parentObject.appendChild(this.hiddenForm);
114
 
 
115
 
                if (this._extendedInit) this._extendedInit();
116
 
                this.xmlLoader=new dtmlXMLLoaderObject(this._parseXMLTree,this);
117
 
                this.setMenuMode("classic");
118
 
 
119
 
                this.setBarSize(this.width,this.height);
120
 
                this.showBar();
121
 
                return this;
122
 
                }
123
 
                
124
 
                dhtmlXMenuBarObject.prototype = new dhtmlXProtobarObject;
125
 
 
126
 
 
127
 
                /**
128
 
          *     @desc: set zIndex value for menu object
129
 
          *     @param: zIndex - (integer) new zIndex value
130
 
          *     @type: public
131
 
          *     @topic: 0
132
 
          */
133
 
        dhtmlXMenuBarObject.prototype.setZIndex=function(zIndex){
134
 
                this.zIndex=zIndex;
135
 
                this.topNod.style.zIndex=this.zIndex;
136
 
                if (this.topNod.ieFix) this.topNod.ieFix.style.zIndex=this.zIndex-1;
137
 
                if ((_isIE)&&(this.parentObject)&&(this.parentObject.style.position=="absolute")) this.parentObject.style.zIndex=zIndex;
138
 
        }
139
 
                /**
140
 
          *     @desc: set zIndex value for menu object
141
 
          *     @param: size - (integer) new icon size
142
 
          *     @type: public
143
 
          *     @topic: 0
144
 
          */
145
 
        dhtmlXMenuBarObject.prototype.setIconSize=function(size){
146
 
                this._aimsize=size;
147
 
        }
148
 
 
149
 
                /**
150
 
          *     @desc: menu panel
151
 
          *     @param: parentPanel - parent panel object
152
 
          *     @param: parentItem - parent menu item
153
 
          *     @param: mode - if eq 1 => horisontal menu bar
154
 
          *     @param: minWidth - minimal panel width
155
 
                  *     @param: withoutImages - enable/disable images in menu items
156
 
          *     @type: private
157
 
          *     @topic: 0
158
 
          */
159
 
        function dhtmlXMenuBarPanelObject(parentPanel,parentItem,mode,minWidth,withoutImages){
160
 
                this.extraMode=!convertStringToBoolean(mode);
161
 
                this.parentPanel=parentPanel;
162
 
                this.parentItem=parentItem;
163
 
                this.parentObject=parentPanel.parentObject;
164
 
                this.topMenu=parentPanel.topMenu;
165
 
                this.topNod=0;
166
 
                this.dividerCell=0;
167
 
                this.firstCell=0;
168
 
                this.nameCell=0;
169
 
                this.crossCell=0;
170
 
                this.maxItems=99;
171
 
                this.items=new Array();
172
 
                this.itemsCount=0;
173
 
                this.withoutImages=(withoutImages==1);
174
 
                this.mixedImages=(withoutImages==2);
175
 
                if (minWidth) this.width=minWidth;
176
 
 
177
 
                if ((!this.topMenu.flsmd)||(this.topMenu!=this.parentPanel))
178
 
                this.parentItem.setHasChild(true);
179
 
                
180
 
                if (mode)
181
 
                        this._createVPanel=this.topMenu._createPanel;
182
 
                else
183
 
                        this._createVPanel=this.topMenu._createVPanel;
184
 
 
185
 
                
186
 
 
187
 
                this._createVPanel();
188
 
                
189
 
                this.topNod.panel=this;
190
 
                this.topNod.onmouseover=this.topMenu._onmouseoverZ;
191
 
                this.topNod.onmouseout=this.topMenu._onmouseoutZ;
192
 
                
193
 
                parentItem.subMenu=this;
194
 
                this.topNod.style.position="absolute";
195
 
                this.topMenu.subMenus[this.topMenu.subMenusCount]=this;
196
 
                this.topMenu.subMenusCount++;
197
 
                return this;
198
 
                }
199
 
                
200
 
                
201
 
                /**
202
 
          *     @desc:  fix z-index problem with select boxes in IE, enabled by default
203
 
          *     @param: mode - enable/disable
204
 
          *     @type: public
205
 
          *     @topic: 0
206
 
          */
207
 
                        dhtmlXMenuBarObject.prototype.enableIESelectBoxFix=function(mode){
208
 
                        this.ieFix=convertStringToBoolean(mode);
209
 
                };
210
 
                /**
211
 
          *     @desc:  enable/disable tooltips
212
 
          *     @param: mode - enable/disable
213
 
          *     @type: public
214
 
          *     @topic: 0
215
 
          */
216
 
                        dhtmlXMenuBarObject.prototype.enableTooltip=function(mode){
217
 
                        this._endtt=(!convertStringToBoolean(mode));
218
 
                };
219
 
 
220
 
 
221
 
                /**
222
 
          *     @desc:  fix z-index problem with select boxes in IE, enabled by default
223
 
          *     @param: mode - disable/enable smart positioning of sub menus
224
 
          *     @type: public
225
 
          *     @topic: 0
226
 
          */
227
 
                        dhtmlXMenuBarObject.prototype.disableSmartPositioning=function(mode){
228
 
                        this._skipAPP=convertStringToBoolean(mode);
229
 
                };
230
 
 
231
 
 
232
 
                /**     
233
 
          *     @desc:  fix z-index problem with select boxes in IE, enabled by default
234
 
          *     @param: mode - enable/disable
235
 
          *     @type: public
236
 
          *     @topic: 0  
237
 
          */ 
238
 
                        dhtmlXMenuBarObject.prototype.enableMenuHandle=function(mode){
239
 
                                if(convertStringToBoolean(mode)) this.dividerCell.style.display="";
240
 
                                else this.dividerCell.style.display="none";
241
 
                };              
242
 
                /**
243
 
          *     @desc:  disable child menu image
244
 
          *     @param: mode - enable/disable
245
 
          *     @type: public
246
 
          *     @topic: 0  
247
 
          */ 
248
 
                        dhtmlXMenuBarObject.prototype.enableChildIcon=function(mode){
249
 
                                this.echsw=convertStringToBoolean(mode);
250
 
                };      
251
 
                /**
252
 
          *     @desc:  disable child menu image
253
 
          *     @param: mode - enable/disable
254
 
          *     @type: public
255
 
          *     @topic: 0  
256
 
          */ 
257
 
                dhtmlXMenuBarObject.prototype.setHrefMode=function(mode){
258
 
                                this._hmode=mode;
259
 
                };      
260
 
                /**
261
 
          *     @desc:  disable child menu image
262
 
          *     @param: mode - enable/disable
263
 
          *     @type: public
264
 
          *     @topic: 0  
265
 
          */ 
266
 
                dhtmlXMenuBarObject.prototype.enableDirectOnClick=function(mode){
267
 
                                this._dirClick=convertStringToBoolean(mode);
268
 
                };      
269
 
                /**     
270
 
          *     @desc:  disable child menu image switching
271
 
          *     @param: mode - enable/disable
272
 
          *     @type: public
273
 
          *     @topic: 0
274
 
          */ 
275
 
                        dhtmlXMenuBarObject.prototype.enableChildIconSwitching=function(mode){
276
 
                                this.echsw2=convertStringToBoolean(mode);
277
 
                };                                              
278
 
                /**     
279
 
          *     @desc:  closed menu behaviour
280
 
          *     @param: mode - enable/disable
281
 
          *     @type: public
282
 
          *     @topic: 0  
283
 
          */ 
284
 
                        dhtmlXMenuBarObject.prototype.enableWindowOpenMode=function(mode){
285
 
                        this.ieWinMode=convertStringToBoolean(mode);
286
 
                };
287
 
                
288
 
                        /**  
289
 
          *     @desc: return item index in collection by id
290
 
          *     @type: private
291
 
                  *     @param: id - item id
292
 
                  *     @topic: 3
293
 
          */            
294
 
                dhtmlXMenuBarObject.prototype._getItemIndex=function(id){
295
 
                        for (var i=0; i<this.gitemsCount; i++)
296
 
                        {
297
 
                                if (this.gitems[i].id==id) return i;
298
 
                        };              
299
 
                        return -1;
300
 
                };
301
 
                /**  
302
 
          *     @desc: return item object by id
303
 
          *     @type: public
304
 
                  *     @param: itemId - item id
305
 
              *     @topic: 4
306
 
          */            
307
 
                dhtmlXMenuBarObject.prototype.getItem=function(itemId){
308
 
                        var z=this._getItemIndex(itemId);
309
 
                        if (z>=0)       return this.gitems[z];
310
 
                };
311
 
                
312
 
 
313
 
                
314
 
                /**
315
 
          *     @desc:  show node in scrolling process
316
 
          *     @param: node - html button node
317
 
          *     @param: rest - scrolling direction
318
 
          *     @type: private
319
 
          *     @topic: 0  
320
 
          */
321
 
                dhtmlXMenuBarObject.prototype._showScroll=function(node,order,rest,mode){
322
 
                        if (!node.items[order]) return;
323
 
                        
324
 
                                        if (mode=="")
325
 
                                                if (rest==1) node.cAr[2]++;
326
 
                                                else node.cAr[0]--;
327
 
                                        else 
328
 
                                                if (rest==1) node.cAr[0]++;
329
 
                                                else node.cAr[2]--;
330
 
 
331
 
                        if ((!node.items[order].CSSTag)||(node.items[order].hide))
332
 
                                        {
333
 
                                        node.items[order].topNod.parentNode.style.display=mode;
334
 
                                        this._showScroll(node,order*1+rest*1,rest,mode);
335
 
                                        }
336
 
                        else
337
 
                                {
338
 
                                node.items[order].topNod.parentNode.style.display=mode;
339
 
                                }
340
 
 
341
 
                        }
342
 
                
343
 
                /**     
344
 
          *     @desc:  set state of  scroll buttons
345
 
          *     @param: node - html button node
346
 
          *     @param: rest - scrolling direction
347
 
          *     @type: private
348
 
          *     @topic: 0  
349
 
          */
350
 
                dhtmlXMenuBarObject.prototype._fixScrollState=function(node,rest){
351
 
                        
352
 
                        if (parseInt(node.topNod.offsetWidth)>parseInt(node.topNod.width))
353
 
                                node.topNod.width=node.topNod.offsetWidth;
354
 
                                
355
 
                        var flag=0;
356
 
 
357
 
                                if (rest>0){
358
 
                                        this._showScroll(node,node.cAr[0],1,"none");
359
 
                                        this._showScroll(node,node.cAr[2],1,"");
360
 
                                }
361
 
                                else{
362
 
                                        this._showScroll(node,node.cAr[0]-1,-1,"");
363
 
                                        this._showScroll(node,node.cAr[2]-1,-1,"none");
364
 
                                }
365
 
                                z.scrollState+=rest*1;
366
 
                                
367
 
                                
368
 
                        if ((node.scrollState*1+node.maxItems*1)==(node.realItemsCount))
369
 
                                node.scrollDown.className="menuScrollerDisabled";
370
 
                        else
371
 
                                {
372
 
                                node.scrollDown.className="menuScrollerEnabled";
373
 
                                flag++;                         
374
 
                                }                               
375
 
                                
376
 
                        if (node.scrollState==0)
377
 
                                node.scrollUp.className="menuScrollerDisabled";
378
 
                        else
379
 
                                {
380
 
                                node.scrollUp.className="menuScrollerEnabled";
381
 
                                flag++;
382
 
                                }
383
 
                                
384
 
                                
385
 
                                return flag;
386
 
                }
387
 
 
388
 
 
389
 
 
390
 
                /**     
391
 
          *     @desc:  start scrolling
392
 
          *     @type: private
393
 
          *     @topic: 0
394
 
          */ 
395
 
                dhtmlXMenuBarObject.prototype._scrollstart=function(){
396
 
                        if (this.timeoutops) clearTimeout(this.timeoutops);
397
 
                        z=this.parentNode.parentNode.parentNode.menu;
398
 
                        if (z.scrollDown==this)
399
 
                                var rest=1;
400
 
                        else
401
 
                                var rest=-1;
402
 
                                
403
 
                        if (z.topMenu._fixScrollState(z,rest)==2) 
404
 
                                this.timeoutops=setTimeout(new z.topMenu._delayedTimerCall(this,"onmouseover",0,0),333);
405
 
                }
406
 
                /**     
407
 
          *     @desc:  stop scrolling
408
 
          *     @type: private
409
 
          *     @topic: 0  
410
 
          */
411
 
                dhtmlXMenuBarObject.prototype._scrollend=function(node){
412
 
                        if (this.timeoutops) window.clearTimeout(this.timeoutops);
413
 
                }
414
 
                /**     
415
 
          *     @desc:  enable/disable scrolling
416
 
          *     @param: node - dhtml button node
417
 
          *     @type: private
418
 
          *     @topic: 0
419
 
          */                    
420
 
                dhtmlXMenuBarObject.prototype._scrollCheck=function(node){
421
 
                        var z_count=0;
422
 
                        for (var i=0; i<node.itemsCount; i++)
423
 
                                if ((node.items[i].CSSTag)&&(!node.items[i].hide)) z_count++;
424
 
 
425
 
                        node.realItemsCount=z_count;
426
 
                        node.cAr=new Array(0,0,0);
427
 
                        if ((node.realItemsCount>node.maxItems)&&(node.scrollDown)){
428
 
                                node.scrollDown.style.display="";
429
 
                                node.scrollUp.style.display="";
430
 
                                node.scrollDown.className='menuScrollerEnabled';
431
 
                                node.scrollState=0;
432
 
                                node.scrollUp.onmouseover=this._scrollstart;
433
 
                                node.scrollUp.onmouseout=this._scrollend;
434
 
                                node.scrollDown.onmouseover=this._scrollstart;
435
 
                                node.scrollDown.onmouseout=this._scrollend;
436
 
                node.cAr[2]=0;
437
 
 
438
 
                                var z_count=0;
439
 
                var b_flag=true;
440
 
                                for (var i=0; i<node.itemsCount; i++)
441
 
                                        {
442
 
                                        if ((node.items[i].CSSTag)&&(!node.items[i].hide)) z_count++;
443
 
                                        if (z_count>node.maxItems) {
444
 
                                                node.items[i].topNod.parentNode.style.display="none";
445
 
                                                if (node.cAr[2]==0) node.cAr[2]=i;      }
446
 
                    else{
447
 
                        node.items[i].topNod.parentNode.style.display="";
448
 
                        }
449
 
 
450
 
                                        }
451
 
               }
452
 
                }
453
 
 
454
 
                dhtmlXMenuBarObject.prototype._scrollClear=function(node){
455
 
                         for (var i=0; i<node.itemsCount; i++){
456
 
                                        if ((node.items[i].CSSTag)&&(!node.items[i].hide))
457
 
                        node.items[i].topNod.parentNode.style.display="";
458
 
                    if (node.scrollDown)
459
 
                                        node.scrollDown.style.display="none";
460
 
                    if (node.scrollUp)
461
 
                                        node.scrollUp.style.display="none";
462
 
                        }
463
 
                }
464
 
 
465
 
                /**  
466
 
          *     @desc: return menu panel object
467
 
          *     @param: panelId - id of panel related menu item
468
 
          *     @type: public
469
 
          *     @topic: 4  
470
 
          */    
471
 
                dhtmlXMenuBarObject.prototype.getPanel=function(panelId){
472
 
                        var z=this._getGItemIndex(panelId);
473
 
                        if (z<0) return this;
474
 
                        else return this.gitems[z].subMenu;
475
 
                }
476
 
                
477
 
                /**  
478
 
          *     @desc: add item to menu
479
 
          *     @param: item - item object
480
 
          *     @param: panel - menu panel  object                
481
 
          *     @type: public
482
 
          *     @topic: 1  
483
 
          */
484
 
                dhtmlXMenuBarObject.prototype.addItem=function(panel,item){
485
 
                        if (this==panel) this.addFirstLevel(panel,item);
486
 
                        else this.addSecondLevel(panel,item);
487
 
                }
488
 
                
489
 
                /**  
490
 
          *     @desc: add item to horisontal oriented menu
491
 
          *     @param: item - item object
492
 
          *     @param: panel - menu panel  object                
493
 
          *     @type: private
494
 
          *     @topic: 0  
495
 
          */                              
496
 
                dhtmlXMenuBarObject.prototype._addItem=function(panel,item){  
497
 
                        panel.items[panel.itemsCount]=item;
498
 
                        panel.firstCell.parentNode.insertBefore(item.getTopNode(),panel.firstCell);
499
 
                        item.getTopNode().style.marginBottom="20px";
500
 
                        item.parentNod=this;
501
 
                        item.parentPanel=panel;
502
 
                        if (this.defaultAction) item.setAction(this.defaultAction);
503
 
                        panel.itemsCount++;
504
 
 
505
 
                        this.gitems[this.gitemsCount]=item;
506
 
                        this.gitemsCount++;
507
 
                }
508
 
 
509
 
                /**
510
 
          *     @desc: add item to vertical oriented menu
511
 
          *     @param: item - item object
512
 
          *     @param: panel - menu panel  object
513
 
          *     @type: private
514
 
          *     @topic: 0
515
 
          */
516
 
                dhtmlXMenuBarObject.prototype.addItem_vertical=function(panel,item){
517
 
                        panel.items[panel.itemsCount]=item;
518
 
                        var tr=document.createElement("tr");
519
 
                        tr.style.verticalAlign="top";
520
 
                        tr.appendChild(item.getTopNode());
521
 
                        panel.firstCell.parentNode.insertBefore(tr,panel.firstCell);
522
 
                        item.parentNod=this;
523
 
                        item.parentPanel=panel;
524
 
                        if (this.defaultAction) item.setAction(this.defaultAction);
525
 
                        panel.itemsCount++;
526
 
 
527
 
                        this.gitems[this.gitemsCount]=item;
528
 
                        this.gitemsCount++;
529
 
                }
530
 
 
531
 
                /**  
532
 
          *     @desc: return item index from global collection by id
533
 
          *     @type: private
534
 
                  *     @param: id - item id
535
 
                  *     @topic: 3
536
 
          */            
537
 
                dhtmlXMenuBarObject.prototype._getGItemIndex=function(id){
538
 
                /*      for (var i=0; i<=this.gitemsCount; i++)
539
 
                        {
540
 
                                if (this.gitems[i].id==id) return i;
541
 
                        };
542
 
                        return -1;
543
 
            */
544
 
            return (this._getItemIndex(id));
545
 
                };
546
 
                
547
 
                /**  
548
 
          *     @desc: remove item
549
 
          *     @type: public
550
 
                  *     @param: id - item id
551
 
              *     @topic: 1
552
 
          */
553
 
        dhtmlXMenuBarObject.prototype.clearAll=function(id){
554
 
                for (var i=0; i<this.gitemsCount; i++)
555
 
                        {
556
 
                                var x=this.gitems[i].getTopNode();
557
 
                                if (this.extraMode) x=x.parentNode;
558
 
                                x.parentNode.removeChild(x);
559
 
                                x=this.gitems[i].parentPanel;
560
 
                                if (x!=this.topMenu && x.topNod){
561
 
                                        x.topNod.parentNode.removeChild(x.topNod);
562
 
                                        x.topNod=null;
563
 
                                }
564
 
                        }
565
 
                        
566
 
                                        
567
 
                        this.items=new Array();
568
 
                        this.itemsCount=0;
569
 
                        this.gitems=new Array();
570
 
                        this.gitemsCount=0;
571
 
                        this.subMenus=new Array();
572
 
                        this.subMenusCount=0;
573
 
                        this.realWinModeStart=this.ieWinModeState=this._lastOpenedPanel=this._lastSelectedItem=null;
574
 
        } 
575
 
                /**  
576
 
          *     @desc: remove item
577
 
          *     @type: public
578
 
                  *     @param: id - item id
579
 
              *     @topic: 1
580
 
          */
581
 
                dhtmlXMenuBarObject.prototype.removeItem=function(id){
582
 
                        var z=this._getGItemIndex(id);
583
 
                        if (z>=0) {
584
 
                        var panel=this.gitems[z].parentPanel;
585
 
                        if (this.gitems[z].removeItem) this.gitems[z].removeItem();
586
 
 
587
 
                        if (panel.firstCell.tagName=="TR")
588
 
               var zw=this.gitems[z].getTopNode().parentNode
589
 
                        else
590
 
               var zw=this.gitems[z].getTopNode().parentNode
591
 
            zw.parentNode.removeChild(zw);
592
 
 
593
 
            panel.itemsCount--;
594
 
                        for (var i=0; i<panel.itemsCount; i++)
595
 
                                if (panel.items[i]==this.gitems[z]){
596
 
                                panel.items[i]=panel.items[i+1];
597
 
                    panel.items[i+1]=this.gitems[z];
598
 
                    }
599
 
                    panel.items[panel.itemsCount]=0;
600
 
 
601
 
            this.gitemsCount--;
602
 
                        for (var i=z; i<this.gitemsCount; i++){
603
 
                                this.gitems[i]=this.gitems[i+1];
604
 
                }
605
 
            this.gitems[this.gitemsCount]=0;
606
 
 
607
 
 
608
 
 
609
 
                        }
610
 
                }
611
 
                  
612
 
                /**  
613
 
          *     @desc: parse xml
614
 
          *     @type: private
615
 
                  *     @param: that - menu object
616
 
                  *     @param: node - current xml node
617
 
                  *     @param: level - menu level
618
 
                  *     @param: parentNode - parent panel
619
 
                  *     @param: aTempNode - parent item
620
 
                  *     @param: mode - menu design mode
621
 
              *     @topic: 2  
622
 
          */
623
 
        dhtmlXMenuBarObject.prototype._parseXMLTree=function(that,node,level,parentNode,aTempNode,mode){
624
 
                if (!node) {
625
 
                        node=that.xmlLoader.getXMLTopNode("menu");
626
 
 
627
 
            if   (that._awaitXML){
628
 
                aTempNode=that._awaitXML;
629
 
                parentNode=aTempNode.parentPanel;
630
 
 
631
 
                level=1;
632
 
                that._awaitXML=null;
633
 
                mode=this.modeValue;
634
 
                }
635
 
            else{
636
 
                     level=0;
637
 
                         parentNode=that;
638
 
 
639
 
                         mode=node.getAttribute("mode");
640
 
                         if (mode)       that.setMenuMode(mode);
641
 
 
642
 
                         var menuAlign=node.getAttribute("menuAlign");
643
 
                         if (menuAlign) that.setBarAlign(menuAlign);
644
 
 
645
 
                         that.maxItems=node.getAttribute("maxItems")||99;
646
 
                         var absolutePosition=node.getAttribute("absolutePosition");
647
 
                         var aleft=node.getAttribute("left");
648
 
                         var atop=node.getAttribute("top");
649
 
                                 if (absolutePosition) that.topNod.style.top=parseInt(atop || 0 )+"px";
650
 
                                 if (absolutePosition) that.topNod.style.left=parseInt(aleft || 0)+"px";
651
 
                         if (absolutePosition=="yes") that.topNod.style.position="absolute";
652
 
 
653
 
                         var name=node.getAttribute("name");
654
 
                         if(name) that.setTitleText(name);
655
 
 
656
 
                         var width=node.getAttribute("width");
657
 
                         var height=node.getAttribute("height");
658
 
                         that.setBarSize(width,height);
659
 
 
660
 
                         var imageTextButtonCssClass=node.getAttribute("imageTextButtonCssClass");
661
 
                         var globalTextCss=node.getAttribute("globalTextCss");
662
 
 
663
 
                        that.globalSecondCss=node.getAttribute("globalSecondCss");
664
 
                        that.globalCss=node.getAttribute("globalCss");
665
 
                        that.globalTextCss=node.getAttribute("globalTextCss");
666
 
                        if (node.getAttribute("withoutImages")) that.withoutImages=true;
667
 
                        if (node.getAttribute("mixedImages")) that.mixedImages=true;
668
 
                        that.type=node.getAttribute("type")||"a1";
669
 
                }
670
 
                        }
671
 
 
672
 
 
673
 
 
674
 
                
675
 
                if (level) {
676
 
//                      create new bar
677
 
                        var parentNode=new dhtmlXMenuBarPanelObject(parentNode,aTempNode,((mode!="classic")&&(mode!="popup")),node.getAttribute("panelWidth"),(node.getAttribute("withoutImages")?1:(node.getAttribute("mixedImages")?2:0)));
678
 
                        parentNode.maxItems=node.getAttribute("maxItems")||that.maxItems;
679
 
                }
680
 
 
681
 
                for(var i=0; i<node.childNodes.length; i++)
682
 
                {    
683
 
                        if (node.childNodes[i].nodeType==1)
684
 
                        {
685
 
                                var localItem=node.childNodes[i]
686
 
 
687
 
                                        if (!level)
688
 
                                        {
689
 
                                                if ((!localItem.getAttribute("className"))&&(that.globalCss))
690
 
                                                        localItem.setAttribute("className",that.globalCss);
691
 
                                        }
692
 
                                        else
693
 
                                                if (!localItem.getAttribute("className"))
694
 
                                                        {
695
 
                                                        if (that.globalSecondCss)
696
 
                                                                localItem.setAttribute("className",that.globalSecondCss);
697
 
                                                        else                    
698
 
                                                                localItem.setAttribute("className","menuButtonSecond");
699
 
                                                        }
700
 
                                        
701
 
                                        
702
 
                                                
703
 
                                        if ((!localItem.getAttribute("textClassName"))&&(that.globalTextCss))
704
 
                                                localItem.setAttribute("textClassName",that.globalTextCss);
705
 
 
706
 
                                        
707
 
                                var tempsrc=localItem.getAttribute("src");
708
 
                                if (parentNode.withoutImages){
709
 
                                        localItem.setAttribute("src","");
710
 
                    localItem.setAttribute("src2", that.sysGfxPath+"blank.gif");
711
 
                    }
712
 
                                else 
713
 
                                        {
714
 
                                        if ((parentNode.mixedImages)&&(tempsrc==null))
715
 
                                                tempsrc=that.sysGfxPath+"blank.gif";
716
 
                                        else 
717
 
                                                tempsrc=that.sysGfxPath+(tempsrc||"blank.gif");
718
 
                                                
719
 
                                        localItem.setAttribute("src",tempsrc);
720
 
                                        }
721
 
 
722
 
                                tempsrc=localItem.getAttribute("width");
723
 
                                if (tempsrc==null){
724
 
                                        localItem.setAttribute("width","100%");
725
 
                                }
726
 
 
727
 
                if (that._endtt)  localItem.setAttribute("tooltip","");
728
 
                if (that._aimsize)  localItem.setAttribute("imageSize",that._aimsize);
729
 
 
730
 
                                var z=eval("window.dhtmlX"+localItem.tagName+"Object");
731
 
                                if (z)
732
 
                                        var TempNode= new z(localItem,node.getAttribute("type")||that.type);
733
 
                                else
734
 
                                        var TempNode=null;
735
 
 
736
 
                                if (localItem.tagName=="divider")
737
 
                                        if ((level)||(that.modeValue=="popup"))
738
 
                                                that.addItem(parentNode,new dhtmlXMenuDividerYObject(localItem.getAttribute("id")));
739
 
                                        else
740
 
                                                that.addItem(parentNode,new dhtmlXMenuDividerXObject(localItem.getAttribute("id")));
741
 
                                else
742
 
                                        if (TempNode)   
743
 
                                                if (level)
744
 
                                                        that.addItem(parentNode,TempNode);
745
 
                                                else
746
 
                                                        that.addItem(parentNode,TempNode);
747
 
 
748
 
                                if (localItem.getAttribute("disabled"))
749
 
                       TempNode.disable();
750
 
 
751
 
                                if ((TempNode)&&(localItem.getAttribute("submenu"))){
752
 
                                        TempNode.submenu=localItem.getAttribute("submenu");
753
 
                                        TempNode.setHasChild(true);
754
 
                                }
755
 
                                
756
 
                                if (that.checkXMLChild(localItem)) that._parseXMLTree(that,localItem,level+1,parentNode,TempNode,mode);
757
 
                        }
758
 
                }
759
 
 
760
 
                that._scrollCheck(parentNode);
761
 
 
762
 
        if (level==0){
763
 
                if (that.topMenu.correctMenuPosition)
764
 
                        that.topMenu.correctMenuPosition(that.topMenu.topNod);
765
 
                        
766
 
                if (that.topMenu.waitCall)
767
 
                        that.topMenu.waitCall();        
768
 
        }
769
 
        }
770
 
 
771
 
                /**
772
 
          *     @desc: check if node has non-text childs
773
 
              *     @type: private
774
 
          *     @topic: 0
775
 
          */
776
 
        dhtmlXMenuBarObject.prototype.checkXMLChild=function(node){
777
 
    for (var i=0; i<node.childNodes.length; i++)
778
 
        if (node.childNodes[i].nodeType==1) return true;
779
 
 
780
 
        return false;
781
 
 
782
 
}
783
 
 
784
 
                /**
785
 
          *     @desc: horisontal menu panel
786
 
              *     @type: private
787
 
          *     @topic: 0
788
 
          */
789
 
        dhtmlXMenuBarObject.prototype._createPanel=function()
790
 
                {
791
 
                        if(!this.width) this.width=1;           
792
 
                        if(!this.height) this.height=1;
793
 
                        if (this.width.toString().indexOf("%")==-1) this.width=parseInt(this.width)+"px";
794
 
                        if (this.height.toString().indexOf("%")==-1) this.height=parseInt(this.height)+"px";                    
795
 
                var div=document.createElement("div");
796
 
                        div.innerHTML='<table cellpadding="0" cellspacing="0" class="'+this.topMenu.tableCSS+'" width="'+this.width+'" height="'+this.height+'"><tbody>' +
797
 
                                                        '<tr>'+
798
 
                                                        '<td width="3px" style="display:none"><div class="menuHandle">&nbsp;</div></td>'+
799
 
                                                        '<td class="'+this.topMenu.titleCSS+'" style="display:none">'+this.topMenu.tname+'</td>'+
800
 
                                                        '<td></td>'+
801
 
                                                        '<td align="right" '+(_isOpera?'':'width="100%"')+' class="'+this.topMenu.titleCSS+'">&nbsp;'+this.topMenu.tname+'</td>'+
802
 
                                                        /*'<td>&nbsp;</td>'*/'<td><td>'+
803
 
                                                        '</tr></tbody></table>';
804
 
                        var table=div.childNodes[0];
805
 
            table.style.display="none";
806
 
                        table.setAttribute("UNSELECTABLE","on");
807
 
                        table.onselectstart=this.topMenu.badDummy;
808
 
                this.topNod=table; 
809
 
                this.dividerCell=table.childNodes[0].childNodes[0].childNodes[0];
810
 
                this.dividerCell.menu=this;
811
 
                this.preNameCell=this.dividerCell.nextSibling;
812
 
                this.firstCell=this.preNameCell.nextSibling;
813
 
                this.nameCell=this.firstCell.nextSibling;                                                       
814
 
                this.crossCell=this.nameCell.nextSibling;                                                       
815
 
                if (this.topMenu!=this){
816
 
                        this.dividerCell.style.display="none";
817
 
                        this.preNameCell.style.display="none";
818
 
                        this.nameCell.style.display="none";
819
 
                        this.crossCell.style.display="none";
820
 
                        table.className=this.topMenu.secTableCSS;
821
 
                        }               
822
 
                this.topNod.style.zIndex=this.topMenu.zIndex;
823
 
 
824
 
                if (this.topMenu.ieFix)
825
 
                        {
826
 
                        var iframe=document.createElement("IFRAME");
827
 
                        if (this._httpsdummy || this.topMenu.sysGfxPath)
828
 
                  iframe.src=(this._httpsdummy||(this.topMenu.sysGfxPath+"/blank.html"));
829
 
 
830
 
                        iframe.style.zIndex=this.topMenu.zIndex-1;  iframe.style.position="absolute";
831
 
                        iframe.style.display="none"; iframe.scrolling="no";             iframe.frameBorder=0;
832
 
                this.parentObject.appendChild(iframe);
833
 
                        this._del_iframe=iframe;
834
 
 
835
 
                        this.topNod.ieFix=iframe;
836
 
                        }
837
 
                this.parentObject.appendChild(table);
838
 
            this._del_table=table;
839
 
                };
840
 
                
841
 
                
842
 
                /**  
843
 
          *     @desc: set menu css classes
844
 
          *     @type: public
845
 
                  *     @param: table - css class for menu container
846
 
                  *     @param: secTable - css class for child menu containers
847
 
                  *     @param: title - css class for toolbar title
848
 
              *     @topic: 4
849
 
          */
850
 
                dhtmlXMenuBarObject.prototype.setMenuCSS=function(table,title,secTable){
851
 
                        this.tableCSS=table;
852
 
                        this.titleCSS=title;
853
 
                        this.secTableCSS=secTable;
854
 
                        this.topNod.className=this.tableCSS;
855
 
                        this.preNameCell.className=this.titleCSS;
856
 
                        this.nameCell.className=this.titleCSS;
857
 
                        
858
 
                }
859
 
 
860
 
 
861
 
        dhtmlXMenuBarObject.prototype._adjustGFXPath=function(path){
862
 
                if (this.extraMode){
863
 
         this.topNod.rows[0].cells[0].childNodes[0].src=path+'btn_up1.gif';
864
 
         this.topNod.rows[this.topNod.rows.length-3].cells[0].childNodes[0].src=path+'btn_up2.gif';
865
 
                 }
866
 
        }
867
 
                /**
868
 
          *     @desc: vertical menu panel
869
 
              *     @type: private
870
 
          *     @topic: 0
871
 
          */
872
 
        dhtmlXMenuBarObject.prototype._createVPanel=function()
873
 
                {
874
 
                        if(!this.width) this.width=120;
875
 
                        if(!this.height) this.height=20;
876
 
                        if (this.width.toString().indexOf("%")==-1) this.width=parseInt(this.width)+"px";
877
 
                        if (this.height.toString().indexOf("%")==-1) this.height=parseInt(this.height)+"px";                    
878
 
                var div=document.createElement("div");
879
 
                        div.innerHTML='<table cellpadding="0" cellspacing="0" class="'+this.topMenu.tableCSS+'" width="'+this.width+'" ><tbody>' +
880
 
                                                        '<tr ><td class="menuScrollerDisabled" style="display:none"><img src="'+this.topMenu.sysGfxPath+'btn_up1.gif"/></td></tr>'+
881
 
                                                        '<tr><td class="'+this.topMenu.titleCSS+'" style="display:none">'+this.tname+'</td></tr>'+
882
 
                                                        '<tr><td></td></tr>'+
883
 
                                                        '<tr><td class="menuScrollerDisabled" style="display:none"><img src="'+this.topMenu.sysGfxPath+'btn_up2.gif"/></td></tr>'+
884
 
                                                        '<tr><td align="right"  class="'+this.topMenu.titleCSS+'" style="display:none">'+this.tname+'</td></tr>'+
885
 
                                                        '<tr><td></td></tr>'+
886
 
                                                        '</tbody></table>';
887
 
 
888
 
                var table=div.childNodes[0];
889
 
        table.style.display='none';
890
 
                this.topNod=table;
891
 
                table.onselectstart=this.topMenu.badDummy;
892
 
                table.setAttribute("UNSELECTABLE","on");
893
 
 
894
 
                this.dividerCell=table.childNodes[0].childNodes[0].childNodes[0];
895
 
//              this.dividerCell.menu=this;
896
 
                table.menu=this;
897
 
                this.scrollUp=this.dividerCell;
898
 
                this.scrollonmouseover="";
899
 
                this.preNameCell=table.childNodes[0].childNodes[1].childNodes[0];
900
 
                this.firstCell=table.childNodes[0].childNodes[2];
901
 
                this.scrollDown=table.childNodes[0].childNodes[3].childNodes[0];
902
 
                this.nameCell=table.childNodes[0].childNodes[4].childNodes[0];
903
 
                this.crossCell=table.childNodes[0].childNodes[5].childNodes[0];
904
 
 
905
 
                if (this.topMenu!=this) {          
906
 
                //this.dividerCell.parentNode.style.display="none";
907
 
                this.preNameCell.parentNode.style.display="none";
908
 
                this.nameCell.parentNode.style.display="none";
909
 
                this.crossCell.parentNode.style.display="none";
910
 
                table.className=this.topMenu.secTableCSS;
911
 
                }
912
 
                
913
 
                this.topNod.style.zIndex=this.topMenu.zIndex;
914
 
 
915
 
                if (this.topMenu.ieFix)
916
 
                        {
917
 
                        var iframe=document.createElement("IFRAME");
918
 
                        iframe.style.zIndex=this.topMenu.zIndex-1;  iframe.style.position="absolute";
919
 
            iframe.src=(this._httpsdummy||(this.topMenu.sysGfxPath+"blank.gif"));
920
 
                        iframe.style.display="none"; iframe.scrolling="no";             iframe.frameBorder=0;
921
 
                this.parentObject.appendChild(iframe);
922
 
             this._del_iframe=iframe;
923
 
 
924
 
                        this.topNod.ieFix=iframe;
925
 
                        }
926
 
                this.parentObject.appendChild(table);
927
 
             this._del_table=table;
928
 
                        };
929
 
 
930
 
                
931
 
                
932
 
                
933
 
 
934
 
                
935
 
                
936
 
/*------------------------------------------------------------------------------
937
 
                                                Menu item object
938
 
--------------------------------------------------------------------------------*/      
939
 
                /**  
940
 
          *     @desc: image button with text object
941
 
          *     @param: id - identificator                
942
 
          *     @param: text - button text                  
943
 
          *     @param: width - object width
944
 
          *     @param: src - image href
945
 
          *     @param: className - css class for button (button use 3 css classes - [className],[className]Over,[className]Down)
946
 
          *     @param: disableImage - alter image for disable mode [optional]
947
 
          *     @param: href - hyperlink [optional]
948
 
          *     @param: target - hyperlink target [optional]
949
 
          *     @param: type - css mode [optional] ( check styling guide for more details  )
950
 
          *     @param: type - image_size - size of image[optional]
951
 
          *     @type: public
952
 
          *     @topic: 0
953
 
          */
954
 
        function dhtmlXMenuItemObject(id,text,width,src,className,disableImage,href,target,type,image_size){
955
 
                        type=type||"a1";
956
 
            var src2="";
957
 
            var tooltip="";
958
 
                        if (id.tagName=="MenuItem")
959
 
                        {
960
 
                                type=text||"a1";
961
 
                                src=id.getAttribute("src");
962
 
                src2=id.getAttribute("src2");
963
 
                                text=id.getAttribute("name");
964
 
                                className=id.getAttribute("className");
965
 
                                disableImage=id.getAttribute("disableImage");
966
 
                                width=id.getAttribute("width");
967
 
                                href=id.getAttribute("href");
968
 
                                if (_isKHTML && href) href=href.replace(/\&\#38;/g,"&");
969
 
                                target=id.getAttribute("target");
970
 
                tooltip=id.getAttribute("tooltip");
971
 
                if ((tooltip!=="")&&(!tooltip)) tooltip=text;
972
 
                                image_size=id.getAttribute("imageSize");
973
 
                                id=id.getAttribute("id");
974
 
                        }
975
 
                        if (id) this.id=id;
976
 
                        else this.id=(new Date()).valueOf();
977
 
                        //width=width||120;
978
 
            src2=src2||src;
979
 
 
980
 
                        image_size=parseInt(image_size)||18;
981
 
 
982
 
 
983
 
                this.topNod=0;
984
 
                this.action=0;          
985
 
                this.persAction=0;
986
 
                this.src=src;
987
 
                this.text=text;
988
 
                this.href=href;
989
 
                this.target=target;
990
 
 
991
 
                this.className=className||"menuButton";
992
 
                this.textClassName="defaultMenuText";
993
 
                this.disableImage=disableImage;
994
 
 
995
 
                td=document.createElement("td");
996
 
                this.topNod=td; td.align="center";
997
 
                td.noWrap=true;
998
 
                if (width && width.toString().indexOf("%")==-1) {
999
 
                                width=parseInt(width)+"px";
1000
 
                                if (_isOpera) td.style.width=width;
1001
 
                        }
1002
 
                                
1003
 
                                var menuhtml="<table align='left' cellpadding='0' cellspacing='0' border='0' style='"+(width?("width:"+width+";"):"")+" height:100%;'><tr><td width='"+(2+image_size)+"px' style=' "+(src?"":"display:none; ")+"'><img src='"+(src2?src2:this.dummyImg())+"' border='0' width='"+image_size+"px' height='"+image_size+"px'/></td>";
1004
 
                                if (this.text.length > 0) menuhtml += "<td width='100%' align='left' style=' "+(src?" padding-left:2px;":"")+" overflow:hidden;' ><table width='100%' height='100%' cellpadding='0' cellspacing='0'><tr><td title='"+tooltip+"' class='"+this.textClassName+"' nowrap='nowrap' >"+this.text+"</td><td width='12px'><img style='display:none' src='"+this.dummyImg()+"'/></td></tr></table></td>";
1005
 
                                else menuhtml += "<td width='100%' align='left' style=' "+(src?" padding-left:2px;":"")+" overflow:hidden; display: none' ><table width='100%' height='100%' cellpadding='0' cellspacing='0'><tr><td title='"+tooltip+"' class='"+this.textClassName+"' nowrap='nowrap' >"+this.text+"</td><td width='12px'><img style='display:none' src='"+this.dummyImg()+"'/></td></tr></table></td>";
1006
 
                                menuhtml+="</tr></table>";
1007
 
                                td.innerHTML = menuhtml;
1008
 
                                this.imageTag=td.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0];
1009
 
                                this.childMenuTag=td.childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0];
1010
 
                this.textTag=this.childMenuTag.parentNode.parentNode.childNodes[0];
1011
 
 
1012
 
                switch(type){
1013
 
                        case "a1":
1014
 
                                this.CSSTag=td;
1015
 
                                this.CSSImageTag=null;
1016
 
                                break;
1017
 
                        case "a2":
1018
 
                                this.CSSTag=td.childNodes[0];
1019
 
                                this.CSSImageTag=null;
1020
 
                                break;
1021
 
                        case "a3":
1022
 
                                this.CSSTag=td.childNodes[0].childNodes[0].childNodes[0].childNodes[1];
1023
 
                                this.CSSImageTag=null;
1024
 
                                break;
1025
 
                        case "b1":
1026
 
                                this.CSSTag=td;
1027
 
                                this.CSSImageTag=this.imageTag.parentNode;
1028
 
                                break;
1029
 
                        case "b2":
1030
 
                                this.CSSTag=td.childNodes[0];
1031
 
                                this.CSSImageTag=this.imageTag.parentNode;
1032
 
                                break;
1033
 
                        case "b3":
1034
 
                                this.CSSTag=td.childNodes[0].childNodes[0].childNodes[0].childNodes[1];
1035
 
                                this.CSSImageTag=this.imageTag.parentNode;
1036
 
                                break;
1037
 
                        }
1038
 
                td.id="menuItem_"+this.id;
1039
 
                this.CSSTag.className=this.className;
1040
 
                td.objectNode=this;
1041
 
                this.enable();
1042
 
                return this;
1043
 
                };
1044
 
 
1045
 
                dhtmlXMenuItemObject.prototype=new dhtmlXButtonPrototypeObject;
1046
 
 
1047
 
                dhtmlXMenuItemObject.prototype.dummyImg=function(){
1048
 
                                return "";
1049
 
                }
1050
 
                
1051
 
                /**
1052
 
          *     @desc: enable object
1053
 
          *     @type: public
1054
 
          *     @topic: 4
1055
 
          */
1056
 
                dhtmlXMenuItemObject.prototype.enable=function(){
1057
 
                        this._dstate=false;
1058
 
                        if (this.disableImage) this.imageTag.src=this.src;
1059
 
                        else
1060
 
                                if (!this.className)
1061
 
                                        this.topNod.className=this.objectNode.className;
1062
 
                                else
1063
 
                                        this.topNod.className=this.className;
1064
 
 
1065
 
                                if (this.textTag)
1066
 
                                        this.textTag.className=this.textClassName;
1067
 
 
1068
 
 
1069
 
        //      this.topNod.onclick=this._onclickX;
1070
 
                this.topNod.onmouseover=this._onmouseoverX;
1071
 
                this.topNod.onmouseout=this._onmouseoutX;
1072
 
                this.topNod.onmousedown=this._onmousedownX;
1073
 
                this.topNod.onmouseup=this._onclickX;
1074
 
                };
1075
 
                
1076
 
                /**
1077
 
          *     @desc: onmousedown handler
1078
 
          *     @type: private
1079
 
                  *     @topic: 2
1080
 
          */                            
1081
 
                dhtmlXMenuItemObject.prototype._onmousedownX=function(e) { if ((!this.objectNode.parentPanel.parentPanel)&&((this.objectNode.subMenu)||(this.objectNode.submenu))) this.objectNode._onclickX(e,this.objectNode); };
1082
 
                 
1083
 
                /**  
1084
 
          *     @desc: set childs sign
1085
 
                  *             @param: newText - new text [ HTML allowed ]
1086
 
          *     @type: private
1087
 
          *     @topic: 4  
1088
 
          */
1089
 
                dhtmlXMenuItemObject.prototype.setHasChild = function(mode){
1090
 
                        if ((convertStringToBoolean(mode))&&(this.parentPanel.topMenu.echsw)) {
1091
 
                                this.childMenuTag.src=this.parentPanel.topMenu.sysGfxPath+'btn_rt1.gif';
1092
 
                                this.childMenuTag.style.display='';
1093
 
                        }
1094
 
                        else    this.childMenuTag.style.display='none';
1095
 
                };      
1096
 
                
1097
 
                /**  
1098
 
          *     @desc: set button text
1099
 
                  *             @param: newText - new text [ HTML allowed ]
1100
 
          *     @type: public
1101
 
          *     @topic: 4
1102
 
          */                            
1103
 
                dhtmlXMenuItemObject.prototype.setText = function(newText){
1104
 
                        this.textTag.innerHTML=newText;
1105
 
                };                      
1106
 
                /**  
1107
 
          *     @desc: inner onclick handler
1108
 
          *     @type: private
1109
 
          *     @topic: 2
1110
 
          */
1111
 
 
1112
 
                dhtmlXMenuItemObject.prototype._onclickX=function(e,that){
1113
 
                        if (!e) e=event;
1114
 
                        e.cancelBubble=true;
1115
 
 
1116
 
                        if (!that)  that=this.objectNode;
1117
 
                        var thatM=that.parentPanel.topMenu;
1118
 
                        if (that.topNod.dstatus) return;
1119
 
 
1120
 
                        thatM._flag_click=that;
1121
 
                        if (that.submenu)  {
1122
 
                                var a_that=that;
1123
 
                                var a_top=thatM;
1124
 
                                thatM.loadXMLFor(that.submenu,that.id,function(){
1125
 
                                        a_that.submenu=null;
1126
 
                                        if (a_top._flag_click==a_that)
1127
 
                        a_that._onclickX([],a_that);
1128
 
                                });
1129
 
                                a_that.submenu=null;                            
1130
 
                                return;
1131
 
                        }
1132
 
 
1133
 
                        if ((thatM.ieWinMode)&&(!thatM.ieWinModeState)&&(that.subMenu))
1134
 
                        {
1135
 
                                that.parentPanel.topMenu._onItemOver(that,that.subMenu);
1136
 
                                if (document.body.currentActiveMenu!=thatM)
1137
 
                                        if (document.body.onmouseup) {  document.body.onmouseup(); }
1138
 
 
1139
 
                                if (thatM.realWinModeStart)
1140
 
                                {
1141
 
 
1142
 
                                that.parentPanel.topMenu.ieWinModeState=1;                              
1143
 
                                
1144
 
 
1145
 
                                if (document.body.onmouseup!=thatM._onclickclose)
1146
 
                                        {
1147
 
                                        thatM.olddoc=document.body.onmouseup;
1148
 
                                        document.body.onmouseup=thatM._onclickclose;
1149
 
                                        }
1150
 
 
1151
 
                                document.body.currentActiveMenu=that.parentPanel.topMenu;
1152
 
                                
1153
 
                                thatM.realWinModeStart=0;
1154
 
                                }
1155
 
                                else thatM.realWinModeStart=1;
1156
 
                                return;
1157
 
                        }
1158
 
                        
1159
 
                        if ((thatM.ieWinMode)&&(thatM.ieWinModeState)&&(that.subMenu)) {
1160
 
                                if ((!thatM.realWinModeStart)&&(that.parentPanel==thatM))
1161
 
                                {
1162
 
                                thatM.realWinModeStart=1;
1163
 
                                return;
1164
 
                                }
1165
 
                                else
1166
 
                                        thatM.realWinModeStart=0;
1167
 
                        }
1168
 
 
1169
 
                        thatM.realWinModeStart=0;
1170
 
                        thatM.ieWinModeState=0;
1171
 
 
1172
 
                        thatM.dropTimers(that.parentPanel);
1173
 
                        thatM._closePanel(that.parentPanel);
1174
 
                        thatM.lastSelectedItem=0;
1175
 
                        thatM.probablyCloseMe=0;
1176
 
                        thatM.lastOpenedPanel="";
1177
 
 
1178
 
                        if (that.parentPanel.topMenu.ieWinMode){
1179
 
                        if (that.parentPanel.topMenu.olddoc) 
1180
 
                                document.body.onclick=that.parentPanel.topMenu.olddoc;
1181
 
                        else
1182
 
                                document.body.onclick=null;
1183
 
                        }
1184
 
 
1185
 
                        if ((that.parentPanel.topMenu.ieWinMode)&&(!that.parentPanel.parentPanel)&&(that.subMenu))
1186
 
                        {
1187
 
                                return;
1188
 
                        }
1189
 
                        
1190
 
                        that.parentPanel.topMenu._unMarkItem(that,"down"); 
1191
 
                        if (that.parentPanel.topMenu._dirClick)
1192
 
                                that._onclickY(0,0);
1193
 
                        else                    
1194
 
                                setTimeout( new that.parentPanel.topMenu._delayedTimerCall(that,"_onclickY",0,0),100);
1195
 
        
1196
 
                        return;
1197
 
                        
1198
 
                };
1199
 
 
1200
 
                dhtmlXMenuBarObject.prototype._onclickclose=function(e){
1201
 
                        var that=this.currentActiveMenu;
1202
 
                        if (that.olddoc)
1203
 
                                document.body.onmouseup=that.olddoc;
1204
 
                        else
1205
 
                                document.body.onmouseup=null;
1206
 
                        that.realWinModeStart=0;
1207
 
                        that.lastOpenedPanel="";
1208
 
                        that.ieWinModeState=0;
1209
 
                        that.dropTimers(that);
1210
 
                        that._closePanel(that);
1211
 
                        that.lastSelectedItem=0;
1212
 
                }
1213
 
                dhtmlXMenuBarObject.prototype.close=function(e){
1214
 
                        if (this.olddoc)
1215
 
                                document.body.onmouseup=this.olddoc;
1216
 
                        else
1217
 
                                document.body.onmouseup=null;
1218
 
                        that.realWinModeStart=0;
1219
 
                        that.lastOpenedPanel="";
1220
 
                        that.ieWinModeState=0;
1221
 
                        that.dropTimers(this);
1222
 
                        that._closePanel(this);
1223
 
                        that.lastSelectedItem=0;
1224
 
                }
1225
 
                /**  
1226
 
          *     @desc: inner onclick handler
1227
 
          *     @type: private
1228
 
          *     @topic: 2 
1229
 
          */                    
1230
 
                dhtmlXMenuItemObject.prototype._onclickY=function(){
1231
 
                        if ((!this.persAction)||(this.persAction()))
1232
 
                                if ((!this.action)||(this.action(this.id)))
1233
 
                        if (this.href){
1234
 
                                if (this.target){
1235
 
                                var form=this.parentPanel.topMenu.hiddenForm;
1236
 
                                        form.action=this.href;
1237
 
                                        form.target=this.target;
1238
 
                                        form.method=(this.parentPanel.topMenu._hmode?this.parentPanel.topMenu._hmode:"GET");
1239
 
                                        form.submit();
1240
 
                                        }
1241
 
                                else document.location.href=this.href;
1242
 
                                return false;
1243
 
                        }
1244
 
                        return false;
1245
 
                };
1246
 
                
1247
 
                /**  
1248
 
          *     @desc: item mouse over handler
1249
 
          *     @param: e - event
1250
 
          *     @type: private
1251
 
          *     @topic: 0  
1252
 
          */
1253
 
                dhtmlXMenuItemObject.prototype._onmouseoverY=function(e){
1254
 
                var that=this.parentPanel.topMenu;
1255
 
                if ((!that.ieWinMode)||(that.ieWinModeState))
1256
 
                        this.parentPanel.topMenu._onItemOver(this,this.subMenu);
1257
 
                else
1258
 
                        {
1259
 
                        if ((that.lastSelectedItem)&&(that.lastSelectedItem!=this))
1260
 
                                this.parentPanel.topMenu._unMarkItem(that.lastSelectedItem);
1261
 
                                
1262
 
                        this.parentPanel.topMenu._markItem(this);
1263
 
 
1264
 
                        }
1265
 
                };
1266
 
                
1267
 
                /**  
1268
 
          *     @desc: item mouse out handler
1269
 
          *     @param: e - event                 
1270
 
          *     @type: private
1271
 
          *     @topic: 0  
1272
 
          */    
1273
 
                dhtmlXMenuItemObject.prototype._onmouseoutY=function(e){
1274
 
                        this.parentPanel.topMenu._onItemOut(this,this.subMenu);
1275
 
                };
1276
 
 
1277
 
                /**  
1278
 
          *     @desc: drop event timers
1279
 
          *     @param: panel - panel object              
1280
 
          *     @type: private
1281
 
          *     @topic: 0  
1282
 
          */ 
1283
 
                dhtmlXMenuBarObject.prototype.dropTimers=function(panel){
1284
 
                        if (!panel) return;
1285
 
                        z=panel.topNod.timeoutop;
1286
 
                        if (z)  clearTimeout(z); 
1287
 
                        
1288
 
                        if (!panel.parentPanel) return;
1289
 
                        var z=panel.parentPanel.topNod.timeoutop;
1290
 
                        if (z)  clearTimeout(z); 
1291
 
                        
1292
 
                        var z=panel.parentItem.topNod.timeoutop;
1293
 
                        if (z)  clearTimeout(z);
1294
 
 
1295
 
 
1296
 
                };
1297
 
 
1298
 
                /**
1299
 
          *     @desc: panel mouse over handler
1300
 
          *     @param: e - event
1301
 
          *     @type: private
1302
 
          *     @topic: 0
1303
 
          */
1304
 
                dhtmlXMenuBarObject.prototype._onmouseoverZ=function(e){
1305
 
                if (!e) e=event; e.cancelBubble=true;
1306
 
                        that=this.panel.topMenu;
1307
 
                        if (this.timeoutop) clearTimeout(this.timeoutop);
1308
 
                        that.dropTimers(this.panel);
1309
 
                        that._onItemOver(0,this.panel);
1310
 
        //                      this.timeoutop=setTimeout( new that._delayedTimerCall(this.panel.topMenu,"_onItemOver",0,this.panel),50);
1311
 
 
1312
 
                };
1313
 
 
1314
 
                /**  
1315
 
          *     @desc: panel mouse out handler
1316
 
          *     @param: e - event                 
1317
 
          *     @type: private
1318
 
          *     @topic: 0  
1319
 
          */ 
1320
 
                dhtmlXMenuBarObject.prototype._onmouseoutZ=function(e){
1321
 
                if (!e) e=event; e.cancelBubble=true;           
1322
 
                        that=this.panel.topMenu;
1323
 
                        if (this.timeoutop) clearTimeout(this.timeoutop);
1324
 
                        
1325
 
                        if ((!that.ieWinMode))
1326
 
                                { 
1327
 
                                this.timeoutop=setTimeout( new that._delayedTimerCall(this.panel.topMenu,"_onItemOut",0,this.panel),200);
1328
 
                                }
1329
 
//                      else                    that.dropTimers(this.panel);
1330
 
                };
1331
 
                
1332
 
                /**  
1333
 
          *     @desc: timer routine
1334
 
          *     @param: object - called object
1335
 
          *     @param: functionName - called function name
1336
 
          *     @param: a - function parametr A 
1337
 
          *     @param: b - function parametr B                                                   
1338
 
          *     @type: private
1339
 
          *     @topic: 0  
1340
 
          */ 
1341
 
                dhtmlXMenuBarObject.prototype._delayedTimerCall=function(object,functionName,a,b,time){
1342
 
                        this.callFunc=function(){
1343
 
                                var ax=a;
1344
 
                                var bx=b;
1345
 
                                object[functionName](ax,bx);
1346
 
                        }
1347
 
                        return this.callFunc;
1348
 
                }
1349
 
                        
1350
 
                        
1351
 
                /**  
1352
 
          *     @desc: confirmed mouse out
1353
 
          *     @param: item - related menu item
1354
 
          *     @param: panel - related menu panel
1355
 
          *     @type: private
1356
 
          *     @topic: 0  
1357
 
          */
1358
 
                dhtmlXMenuBarObject.prototype._onItemOut=function(item,panel){
1359
 
                        if (!panel){
1360
 
                                 if ((item)&&(!item.subMenu))
1361
 
                                        this._unMarkItem(item);
1362
 
                                 return;
1363
 
                         }
1364
 
                        if (this.ieWinMode)
1365
 
                                if ((panel.topMenu==panel)||((item)&&(this.ieWinModeState==1)))  return;
1366
 
                         if (item) this._unMarkItem(item);
1367
 
                         this._closePanel(panel);
1368
 
                }
1369
 
                
1370
 
                /**  
1371
 
          *     @desc: confirmed mouse over
1372
 
          *     @param: item - related menu item
1373
 
          *     @param: panel - related menu panel
1374
 
          *     @type: private
1375
 
          *     @topic: 0  
1376
 
          */
1377
 
                dhtmlXMenuBarObject.prototype._onItemOver=function(item,panel){
1378
 
                        if (item){
1379
 
                        if ((this.lastSelectedItem)&&(this.lastSelectedItem!=item))
1380
 
                                {
1381
 
                                if ((!this.lastSelectedItem.subMenu)||(this.lastSelectedItem.subMenu!=item.parentPanel))
1382
 
                                        this._unMarkItem(this.lastSelectedItem);
1383
 
                                }
1384
 
 
1385
 
                        this.lastSelectedItem=item;
1386
 
 
1387
 
                if (this.ieWinMode)
1388
 
                        {
1389
 
//                      if (item.topNod.className!=item.className+"down") item.topNod.className=item.className+"down";
1390
 
                        this._markItem(item,"down");
1391
 
                        }
1392
 
                else
1393
 
                        {
1394
 
                        //if (item.topNod.className!=item.className+"over") item.topNod.className=item.className+"over";
1395
 
                                this._markItem(item);
1396
 
                        }
1397
 
                        var zp=item.parentPanel;
1398
 
                        if ((zp._lastSelectedItem)&&(zp._lastSelectedItem!=item))
1399
 
                                 if (zp._lastSelectedItem.subMenu) 
1400
 
                                        this._closePanel(zp._lastSelectedItem.subMenu);
1401
 
 
1402
 
                        
1403
 
                        item.parentPanel._lastSelectedItem=item;
1404
 
                                        }
1405
 
                        if (panel) this._openPanel(panel);
1406
 
                        
1407
 
                        this._flag_click=item;
1408
 
                        if (item.submenu)  {
1409
 
                                var a_that=item;
1410
 
                                var a_top=this;
1411
 
                                this.loadXMLFor(item.submenu,item.id,function(){
1412
 
                                        a_that.submenu=null;
1413
 
                                        if (a_top._flag_click==a_that)
1414
 
                        a_top._onItemOver(a_that,a_that.subMenu);
1415
 
                                });
1416
 
                                a_that.submenu=null;                            
1417
 
                                return;
1418
 
                        }
1419
 
                        
1420
 
                }
1421
 
 
1422
 
                /**  
1423
 
          *     @desc: open menu panel
1424
 
          *     @param: panel - related menu panel
1425
 
          *     @type: private
1426
 
          *     @topic: 0
1427
 
          */
1428
 
                dhtmlXMenuBarObject.prototype._openPanel=function(panel){
1429
 
 
1430
 
                        if ((this.lastOpenedPanel)&&(this.lastOpenedPanel!=panel)&&(this.lastOpenedPanel.parentPanel!=panel)&&(this.lastOpenedPanel!=panel.parentPanel))
1431
 
                                {
1432
 
                                this._closePanel(this.lastOpenedPanel);
1433
 
                                }
1434
 
                        
1435
 
                        var z=panel.topNod.timeoutop;
1436
 
                        if (z)  clearTimeout(z); 
1437
 
                        if (panel.topNod.style.display=="") return;
1438
 
                        if (this.lastOpenedPanel!=panel)
1439
 
                        {
1440
 
                        this.lastOpenedPanel=panel;
1441
 
                        switch(this.modeValue){
1442
 
                                case "classic":
1443
 
                        if (panel.topMenu!=panel.parentPanel)   {
1444
 
                                panel.topNod.style.left=getAbsoluteLeft(panel.parentItem.topNod)*1+panel.parentItem.topNod.offsetWidth*1+"px";
1445
 
                                panel.topNod.style.top=getAbsoluteTop(panel.parentItem.topNod)+"px";                            }
1446
 
                        else    {
1447
 
                                panel.topNod.style.left=getAbsoluteLeft(panel.parentItem.topNod)+"px";
1448
 
                                panel.topNod.style.top=getAbsoluteTop(panel.parentItem.topNod)*1+panel.parentItem.topNod.offsetHeight*1-1+"px";                         }
1449
 
                                        break;
1450
 
                                case "popup":
1451
 
                                panel.topNod.style.left=getAbsoluteLeft(panel.parentItem.topNod)*1+panel.parentItem.topNod.offsetWidth*1+"px";
1452
 
                                panel.topNod.style.top=getAbsoluteTop(panel.parentItem.topNod)+"px";
1453
 
                                        break;
1454
 
                                case "betta":
1455
 
                        if (panel.topMenu!=panel.parentPanel)   {
1456
 
                                panel.topNod.style.left=getAbsoluteLeft(panel.parentItem.topNod)*1+"px";
1457
 
                                panel.topNod.style.top=getAbsoluteTop(panel.parentItem.topNod)+panel.parentItem.topNod.offsetHeight*1-1+"px";                           }
1458
 
                        else    {
1459
 
                                panel.topNod.style.left=getAbsoluteLeft(panel.parentItem.topNod)*1+panel.parentItem.topNod.offsetWidth*1+"px";
1460
 
                                panel.topNod.style.top=getAbsoluteTop(panel.parentItem.topNod)+"px";                    }
1461
 
                                        break;                                                                          
1462
 
                                case "alfa":
1463
 
                        panel.topNod.style.top=getAbsoluteTop(panel.parentItem.topNod)*1+panel.parentItem.topNod.offsetHeight*1-1+"px";
1464
 
                        panel.topNod.style.left=getAbsoluteLeft(panel.parentItem.topNod)+"px";
1465
 
                                        break;
1466
 
                                }
1467
 
                        if (panel.topNod.parentNode.style.position=="absolute"){
1468
 
                                panel.topNod.style.top  = parseInt(panel.topNod.style.top) -getAbsoluteTop( panel.topNod.parentNode)+"px";
1469
 
                                panel.topNod.style.left = parseInt(panel.topNod.style.left)-getAbsoluteLeft(panel.topNod.parentNode)+"px";
1470
 
                        }
1471
 
 
1472
 
                        panel.topNod.style.display="";
1473
 
                        if (panel.topNod.ieFix)
1474
 
                                {
1475
 
                        panel.topNod.ieFix.style.top=panel.topNod.style.top;
1476
 
                        panel.topNod.ieFix.style.left=panel.topNod.style.left;
1477
 
                        panel.topNod.ieFix.style.width=panel.topNod.offsetWidth+"px";
1478
 
                        panel.topNod.ieFix.style.height=panel.topNod.offsetHeight+"px";
1479
 
                        panel.topNod.ieFix.style.display="";
1480
 
                                }
1481
 
                        }
1482
 
                        if (!this._skipAPP) this._fixPanelPosition(panel);
1483
 
                }
1484
 
 
1485
 
                dhtmlXMenuBarObject.prototype._fixPanelPosition=function(panel,mode){
1486
 
                        var uf=0;
1487
 
                        if (panel.parentPanel){
1488
 
                        var xs=document.body.offsetWidth-15+document.body.scrollLeft;
1489
 
                        var ys=document.body.offsetHeight-15+document.body.scrollTop;
1490
 
                        //now check is panel real visible
1491
 
                        if ((panel.topNod.offsetWidth+parseInt(panel.topNod.style.left))>xs)
1492
 
                        {
1493
 
                                //x-axis overflow
1494
 
                                if (!panel.parentPanel.extraMode){
1495
 
                                        //v layouts
1496
 
                                        var z=xs-panel.topNod.offsetWidth;
1497
 
                                        if (z<0) z=0;
1498
 
                                        panel.topNod.style.left=z+"px";
1499
 
                                        if (panel.topNod.ieFix) panel.topNod.ieFix.style.left=z+"px";
1500
 
                                }
1501
 
                                else {
1502
 
                                        // h-layout
1503
 
                                        var z=parseInt(panel.topNod.style.left)-panel.topNod.offsetWidth-panel.parentItem.topNod.offsetWidth;
1504
 
                                        if (z<0) { 
1505
 
                                                var z2=parseInt(panel.topNod.style.top)+panel.parentItem.topNod.offsetHeight;
1506
 
                                                        panel.topNod.style.top=z2+"px";
1507
 
                                                if (panel.topNod.ieFix) panel.topNod.ieFix.style.top=z2+"px";
1508
 
 
1509
 
                                                z=xs-panel.topNod.offsetWidth; if (z<0) z=0; }
1510
 
                                        panel.topNod.style.left=z+"px";
1511
 
                                        if (panel.topNod.ieFix) panel.topNod.ieFix.style.left=z+"px";
1512
 
                                }
1513
 
 
1514
 
                        }
1515
 
                        if ((panel.topNod.offsetHeight+parseInt(panel.topNod.style.top))>ys)
1516
 
                        {
1517
 
                                //y-overflow overflow
1518
 
 
1519
 
                                //x-axis overflow
1520
 
                                if (panel.parentPanel.extraMode){
1521
 
                                        //v layouts
1522
 
                                        var z=ys-panel.topNod.offsetHeight;
1523
 
                                        if (z<0) z=0;
1524
 
                                        panel.topNod.style.top=z+"px";
1525
 
                                        if (panel.topNod.ieFix) panel.topNod.ieFix.style.top=z+"px";
1526
 
                                }
1527
 
                                else {
1528
 
                                        // h-layout
1529
 
                                        var z=parseInt(panel.topNod.style.top)-panel.topNod.offsetHeight-panel.parentItem.topNod.offsetHeight;
1530
 
                                        if (z<0) { 
1531
 
                                                var z2=parseInt(panel.topNod.style.left)+panel.parentItem.topNod.offsetWidth;
1532
 
                                                        panel.topNod.style.left=z2+"px";
1533
 
                                                if (panel.topNod.ieFix) panel.topNod.ieFix.style.left=z2+"px";
1534
 
                                                uf=1;
1535
 
                                                z=ys-panel.topNod.offsetHeight; if (z<0) z=0; }
1536
 
                                        panel.topNod.style.top=z+"px";
1537
 
                                        if (panel.topNod.ieFix) panel.topNod.ieFix.style.top=z+"px";
1538
 
                                }
1539
 
                                
1540
 
                        }
1541
 
                        
1542
 
                        }
1543
 
                        
1544
 
                        if ((uf)&&(!mode)) this._fixPanelPosition(panel,1);
1545
 
                }
1546
 
                /**  
1547
 
          *     @desc: close menu panel
1548
 
          *     @param: panel - related menu panel
1549
 
          *     @type: private
1550
 
          *     @topic: 0  
1551
 
          */            
1552
 
                dhtmlXMenuBarObject.prototype._closePanel=function(panel){
1553
 
                        if (!panel) return;
1554
 
//                      if ((this.lastOpenedPanel)&&(!this.lastOpenedPanel.parentPanel.parentPanel)&&(this.lastOpenedPanel!=panel))
1555
 
        //                      this._closeBottomPanels(panel,1);
1556
 
                //      else
1557
 
                                if ((this.lastSelectedItem)&&(this.lastSelectedItem.parentPanel==panel)) this._unMarkItem(this.lastSelectedItem);
1558
 
                                this._closeBottomPanels(panel);
1559
 
                                this._closeTopPanels(panel);
1560
 
 
1561
 
                        this.lastOpenedPanel="";
1562
 
                }
1563
 
 
1564
 
                dhtmlXMenuBarObject.prototype._closeTopPanels=function(panel){
1565
 
                        if ((this.lastSelectedItem)&&(this.lastSelectedItem.parentPanel==panel)) this._unMarkItem(this.lastSelectedItem);
1566
 
                        for (var i=0; i<panel.itemsCount; i++)
1567
 
                        {
1568
 
                                var zi=panel.items[i];
1569
 
                                if ((zi.subMenu)&&(zi.subMenu.topNod.style.display!="none"))
1570
 
                                {
1571
 
                                        zi.subMenu.topNod.style.display="none";
1572
 
                                        this._unMarkItem(zi.subMenu.parentItem);
1573
 
                                        if (zi.subMenu.topNod.ieFix) zi.subMenu.topNod.ieFix.style.display="none"
1574
 
                                        this._closeTopPanels(zi.subMenu);
1575
 
                                        return;
1576
 
                                }
1577
 
                        }
1578
 
                        
1579
 
                }
1580
 
                /**  
1581
 
          *     @desc: close parent panels
1582
 
          *     @param: panel - related menu panel
1583
 
          *     @type: private
1584
 
          *     @topic: 0
1585
 
          */            
1586
 
                dhtmlXMenuBarObject.prototype._closeBottomPanels=function(panel,ieWinMode){
1587
 
                        if (panel.parentPanel) 
1588
 
                                {
1589
 
                        
1590
 
                                
1591
 
                                if ((!this.lastSelectedItem)||(this.lastSelectedItem.parentPanel!=panel.parentPanel))
1592
 
                                        {
1593
 
                                        this._closeBottomPanels(panel.parentPanel);
1594
 
                                        }
1595
 
                                else this.lastOpenedPanel=panel;
1596
 
                                panel.topNod.style.display="none";
1597
 
                                this._unMarkItem(panel.parentItem);
1598
 
                                if (panel.topNod.ieFix) panel.topNod.ieFix.style.display="none"
1599
 
                                }
1600
 
                }
1601
 
        
1602
 
                /**  
1603
 
          *     @desc: mark node as unselected
1604
 
          *     @param: item - menu item object
1605
 
          *     @type: private
1606
 
          *     @topic: 0  
1607
 
          */    
1608
 
                dhtmlXMenuBarObject.prototype._unMarkItem=function(item){
1609
 
                        item.CSSTag.className=item.className;
1610
 
                        if (item.CSSImageTag) item.CSSImageTag.className="";
1611
 
                        if ((item.childMenuTag.src!="")&&(this.topMenu.echsw)&&(this.topMenu.echsw2))
1612
 
                                item.childMenuTag.src=this.topMenu.sysGfxPath+"btn_rt1.gif";
1613
 
                        
1614
 
                }
1615
 
                /**
1616
 
          *     @desc: mark node as selected
1617
 
          *     @param: item - menu item object
1618
 
          *     @param: over - css class sufix
1619
 
          *     @type: private
1620
 
          *     @topic: 0  
1621
 
          */    
1622
 
                dhtmlXMenuBarObject.prototype._markItem=function(item,over){
1623
 
                                over=over||"over";
1624
 
                                item.CSSTag.className=item.className+over;
1625
 
                                if (item.CSSImageTag) item.CSSImageTag.className=item.className+over+"img";
1626
 
                                
1627
 
                                if ((item.childMenuTag.src!="") &&(this.topMenu.echsw)&&(this.topMenu.echsw2))
1628
 
                                        item.childMenuTag.src=this.topMenu.sysGfxPath+"btn_rt2.gif";
1629
 
                                
1630
 
                }
1631
 
                                
1632
 
                /**  
1633
 
          *     @desc: set menu design
1634
 
          *     @param: modeValue - name of design
1635
 
          *     @type: public
1636
 
          *     @topic: 0  
1637
 
          */    
1638
 
                dhtmlXMenuBarObject.prototype.setMenuMode=function(modeValue){
1639
 
                        this.modeValue=modeValue;
1640
 
                        switch(modeValue){
1641
 
                                case "classic":
1642
 
                                        this.addFirstLevel=this._addItem;
1643
 
                                        this.addSecondLevel=this.addItem_vertical;
1644
 
                                        break;
1645
 
                                case "alfa":
1646
 
                                        this.addFirstLevel=this._addItem;
1647
 
                                        this.addSecondLevel=this._addItem;
1648
 
                                        break;
1649
 
                                case "popup":
1650
 
                                        this.addFirstLevel=this.addItem_vertical;
1651
 
                                        this.addSecondLevel=this.addItem_vertical;
1652
 
                                        break;
1653
 
                                case "betta":
1654
 
                                        this.addFirstLevel=this.addItem_vertical;
1655
 
                                        this.addSecondLevel=this._addItem;
1656
 
                                        break;
1657
 
                                };
1658
 
                }
1659
 
 
1660
 
                
1661
 
 
1662
 
                        
1663
 
/*------------------------------------------------------------------------------
1664
 
                                                                VDivider object
1665
 
--------------------------------------------------------------------------------*/
1666
 
                /**  
1667
 
          *     @desc: vertical divider object
1668
 
          *     @param: id - identificator
1669
 
          *     @type: public
1670
 
          *     @topic: 0  
1671
 
          */
1672
 
        function dhtmlXMenuDividerYObject(id){
1673
 
                this.topNod=0;
1674
 
                if (id) this.id=id;     else this.id=0;
1675
 
                td=document.createElement("td");                
1676
 
                this.topNod=td; td.align="center"; td.style.padding="2px 2px 1px 2px";
1677
 
                td.innerHTML="<div class='menuDividerY'>&nbsp;</div>";
1678
 
                                if (!document.all) td.childNodes[0].style.height="0px";
1679
 
                return this;
1680
 
        };
1681
 
        dhtmlXMenuDividerYObject.prototype = new dhtmlXButtonPrototypeObject;
1682
 
        
1683
 
/*------------------------------------------------------------------------------
1684
 
                                                                End of vDivider object
1685
 
--------------------------------------------------------------------------------*/      
1686
 
 
1687
 
/*------------------------------------------------------------------------------
1688
 
                                                                HDivider object
1689
 
--------------------------------------------------------------------------------*/
1690
 
                /**  
1691
 
          *     @desc: horisontal divider object
1692
 
          *     @param: id - identificator
1693
 
          *     @type: public
1694
 
          *     @topic: 0  
1695
 
          */            
1696
 
        function dhtmlXMenuDividerXObject(id){
1697
 
                this.topNod=0;
1698
 
                if (id) this.id=id;     else this.id=0;
1699
 
                td=document.createElement("td");                
1700
 
                this.topNod=td; td.align="center"; td.style.paddingRight="2px"; td.style.paddingLeft="2px"; td.width="4px";
1701
 
                td.innerHTML="<div class='menuDivider'></div    >";
1702
 
                if (!document.all) {  td.childNodes[0].style.width="0px";  td.style.padding="0px 0px 0px 0px"; td.style.margin="0px 0px 0px 0px";       }
1703
 
                return this;
1704
 
        };
1705
 
        dhtmlXMenuDividerXObject.prototype = new dhtmlXButtonPrototypeObject;
1706
 
/*------------------------------------------------------------------------------
1707
 
                                                                End of hDivider object
1708
 
--------------------------------------------------------------------------------*/
1709
 
//(c)dhtmlx ltd. www.dhtmlx.com
1710