function IconManager(name,dataSource, mode, headerMsg, headerOffset, viewProps) { this.name=name; this.dataSource = (dataSource?dataSource:new Array()); this.outWin = null; this.selectedItems = null; this.mode = mode?mode:2; this.header = headerMsg?headerMsg:""; this.headerOffset = isNaN(parseInt(headerOffset))?50:parseInt(headerOffset); this.view = viewProps?viewProps:new ViewProperties; this.items = null; }; new IconManager("initialize"); IconManager.prototype.build = function() { var cells = new Array(); var dragText = (this.enableDrag)?" onMouseDown=\"return(startDrag(event,,this));\"":""; for(var cell=0; cell < this.dataSource.length; cell++) { cells[cell] = "
\""\"\"
\"\"
"; cells[cell] += (this.view.hideTitles||this.dataSource[cell][-14]==""?"":(this.mode==2?"":"") + "" + this.makeIconTitle(cell) + "") + ""; } this.items = cells; }; IconManager.prototype.makeIconTitle = function(cell) { var status = this.dataSource[cell][3]; var msgOptions = this.dataSource[cell][17]; var URLString = "href=\"" + path + this.dataSource[cell][19] + "\" target=\"" + cell + "\"" + (this.view.lock?" onClick=\"srcwin.URLClick(activeManager.dataSource[" + cell + "]," + cell + ");return false;\"":" onMouseDown=\"return(startDrag(event," + cell + ",this));\" onClick=\"return false;\"") + ">"; var baseStyle = ((decodeBitField(permissions,0x0004) && !(decodeBitField(status,0x0410)) && this.dataSource[cell][0]==1)?4:0) ; if(this.dataSource[cell][14]==7) { baseStyle += (decodeBitField(status,0x0200)?2:0); var outString = ""; if(decodeBitField(status,0x0800)) outString = "" + outString; } else if(this.dataSource[cell][14]==8) { var outString = ""; if(decodeBitField(msgOptions,0x1C00)) outString = ">11)][0] + ": " + outString; if(decodeBitField(msgOptions,0xE000)) outString = ">14)][0] + ": " + outString; if(decodeBitField(msgOptions,0x0100)) outString = "" + outString; } return "" + outString + ""; }; IconManager.prototype.select = function(index) { if(this.selectedItems==null) { this.selectedItems = new Array(); for(var item=0; item < this.dataSource.length; item++) this.selectedItems[item] = false; } this.selectedItems[index] = !this.selectedItems[index] } IconManager.prototype.getSelectedItems = function() { var selectedArray = new Array(); if(this.selectedItems != null) { for(var item=0; item < this.selectedItems.length; item++) if(this.selectedItems[item]) selectedArray[selectedArray.length] = item; } return selectedArray; }; IconManager.prototype.getItemFromSysID = function(sysID) { for(var item=0; item < this.dataSource.length && this.dataSource[item][13] != sysID; item++); if(item==this.dataSource.length) return 0; else return this.dataSource[item]; }; function decodeBitField(bitfield, bit) { var result = bitfield&bit; return result; }