/*--------------------------------------------------*//* Build at {ts '2010-10-14 08:02:22'} *//*--------------------------------------------------*//*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/wick.js *//*--------------------------------------------------*//*WICK: Web Input Completion Kithttp://wick.sourceforge.net/Copyright (c) 2004, Christopher T. HollandAll rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.Neither the name of the Christopher T. Holland, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */Ext.namespace("WICK");WICK = {  inKeyMode: false,  siw: null,  collectionIndex: [],  sampleData: [    'Majid Ghasemi <majid@hyperoffice.com>',    'Javid Najafi <javid@hyperoffice.com>',    'Drew <drew@hyperoffice.com>',    'Shadi <shadi@hyperoffice.com>',    'Mahkameh <mahkameh@hyperoffice.com>',    'Zubin Khavarian <zubin@hyperoffice.com>',    'Ghazaleh Famili <ghazaleh@hyperoffice.com>',    'Sadaf <sadaf@hyperoffice.com>',    'Ali Ahari <ali@hyperoffice.com>',    'Amir Abbasi <amir@hyperoffice.com>',    'Abbas Gholami <abbas@hyperoffice.com>',    'Abdollah Nikpay <abdollah@hyperoffice.com>',    'Arash Bahrami <arash@hyperoffice.com>',    'Armin Ataee <armin@hyperoffice.com>',    'Afshin Majidi <afshin@hyperoffice.com>',    'Babak Farazi <babak@hyperoffice.com>',    'Behzad Aghaloo <behzad@hyperoffice.com>',    'Behnam Firoozan <behnam@hyperoffice.com>',    'Bijan Behmardi <bijan@hyperoffice.com>'  ],  isWithinNode: function(e /* element */, i, c /* class name */, t) {  	var answer = false;  	var te = e;    while (te && !answer) {  		if (        //(te.id && (te.id == i)) ||        (te.className && (te.className == i + "Class")) ||        (!t && c && te.className && (te.className == c)) ||        (!t && c && te.className && (te.className.indexOf(c) != -1))      )      {  			answer = te;  		} else {  			te = te.parentNode;  		}  	}  	return te;  },  eventHandlers: {    handleKeyPress: function(event) {    	var e = Ext.lib.Event.getEvent(event);    	var eL = Ext.lib.Event.getTarget(event);    	var upEl = WICK.isWithinNode(eL, null, "wickEnabled", null);    	var kc = e.keyCode;    	if (WICK.siw && kc == Ext.EventObject.ENTER){/* 13 *///) || (kc == Ext.EventObject.TAB /* 9 */))) {    		WICK.siw.selectingSomething = true;        if (WICK.siw.isSafari) {    			WICK.siw.inputBox.blur(); // hack to "wake up" safari        }    		WICK.siw.inputBox.focus();    		WICK.siw.inputBox.value = WICK.siw.inputBox.value.replace(/[ \r\n\t\f\s]+$/gi, ' ');    		WICK.hideSmartInputFloater();    	}      else {        if (          upEl &&          (kc != Ext.EventObject.UP /* 38 */) &&          (kc != Ext.EventObject.DOWN /* 40 */) &&          (kc != Ext.EventObject.LEFT /* 37 */) &&          (kc != Ext.EventObject.RIGHT /* 39 */) &&          (kc != Ext.EventObject.ENTER /* 13 */) &&          (kc != Ext.EventObject.ESC /* 27 */)        ) {      		if (!WICK.siw || (WICK.siw && !WICK.siw.selectingSomething)) {      			WICK.processSmartInput(upEl);      		}      	}        else {          WICK.inKeyMode = false;          if (WICK.siw && WICK.siw.inputBox) {        		WICK.siw.inputBox.focus(); // kinda part of the hack.        	}        }      }    },    handleKeyDown: function(event) {      if(!WICK.siw) {        return; //Jump out      }    	var e = Ext.lib.Event.getEvent(event);    	//var eL = Ext.lib.Event.getTarget(event);      var kc = e.keyCode;      switch (kc) {        case Ext.EventObject.DOWN: //40    			WICK.siw.selectingSomething = true;    			Ext.lib.Event.stopEvent(e);    			/*          if (WICK.siw.isGecko) {    				WICK.siw.inputBox.blur(); //Gecko hack          }          */          WICK.inKeyMode = true;    			WICK.selectNextSmartInputMatchItem();          break;        case Ext.EventObject.UP: //38    			WICK.siw.selectingSomething = true;    			Ext.lib.Event.stopEvent(e);    			/*          if (WICK.siw.isGecko) {    				WICK.siw.inputBox.blur();          }          */          WICK.inKeyMode = true;    			WICK.selectPreviousSmartInputMatchItem();          break;        case Ext.EventObject.ENTER: //13        //case Ext.EventObject.TAB: //9    			WICK.siw.selectingSomething = true;    			WICK.activateCurrentSmartInputMatch();    			Ext.lib.Event.stopEvent(e);          break;        case Ext.EventObject.ESC: //27    			WICK.hideSmartInputFloater();    			Ext.lib.Event.stopEvent(e);          break;        default:          WICK.siw.selectingSomething = false;          break;      }    },    handleClick: function(event) {      var e = Ext.lib.Event.getEvent(event);      var eL = Ext.lib.Event.getTarget(event);      if(!WICK.isWithinNode(eL, null, "matchedSmartInputItem", null)) {        WICK.hideSmartInputFloater();      }      if (WICK.siw && WICK.siw.selectingSomething) {        WICK.selectFromMouseClick();      }    },    handleMouseOver: function(event) {      if(WICK.inKeyMode === true) {        return;      }      if(!WICK.siw) {        return; //Jump out      }      //var e = Ext.lib.Event.getEvent(event);      var eL = Ext.lib.Event.getTarget(event);      var mEl = WICK.isWithinNode(eL, null, "matchedSmartInputItem", null);      if (mEl) {        WICK.siw.selectingSomething = true;        WICK.selectFromMouseOver(mEl);      }      else {        WICK.siw.selectingSomething = false;      }    }  },  showSmartInputFloater: function() {  	if (!WICK.siw.floater.dom.style.display || (WICK.siw.floater.dom.style.display == "none")) {  		if (!WICK.siw.customFloater) {  			var x = Ext.lib.Dom.getX(WICK.siw.inputBox);  			var y = Ext.lib.Dom.getY(WICK.siw.inputBox) + WICK.siw.inputBox.offsetHeight;  			// hack: browser-specific adjustments.  			if (!WICK.siw.isGecko && !WICK.siw.isWinIE) {  				x += 8;  				y += 10;  			}        WICK.siw.floater.dom.style.width = WICK.siw.inputBox.style.width;  			WICK.siw.floater.dom.style.left = x + "px";  			WICK.siw.floater.dom.style.top = y + "px";  		} else {  			// you may  			// do additional things for your custom floater  			// beyond setting display and visibility  		}  		WICK.siw.floater.dom.style.display = "block";  		WICK.siw.floater.dom.style.visibility = "visible";  	}  },  hideSmartInputFloater: function() {  	if (WICK.siw) {  		WICK.siw.floater.dom.style.display = "none";  		WICK.siw.floater.dom.style.visibility = "hidden";  		//WICK.siw = null;  	}// WICK.siw exists  },  processSmartInput: function(inputBox) {  	if (!WICK.siw) {  		WICK.siw = new WICK.SmartInputWindow();    }  	WICK.siw.inputBox = inputBox;  	var classData = inputBox.className.split(" ");  	var siwDirectives = null;  	for (var i = 0; (!siwDirectives && classData[i]); i++) {  		if (classData[i].indexOf("wickEnabled") != -1) {  			siwDirectives = classData[i];      }  	}  	if (siwDirectives && (siwDirectives.indexOf(":") != -1)) {  		WICK.siw.customFloater = true;  		newFloaterId = siwDirectives.split(":")[1];  		//WICK.siw.floater = document.getElementById(newFloaterId);      WICK.siw.floater = Ext.get(newFloaterId);  		WICK.siw.floaterContent = WICK.siw.floater.dom.getElementsByTagName("div")[0];  	}  	WICK.setSmartInputData();  	if (WICK.siw.matchCollection && (WICK.siw.matchCollection.length > 0)) {  		WICK.selectSmartInputMatchItem(0);    }  	var content = WICK.getSmartInputBoxContent();  	if (content) {  		WICK.modifySmartInputBoxContent(content);  		WICK.showSmartInputFloater();  	}    else {  		WICK.hideSmartInputFloater();    }  },  SmartInputMatch: function(cleanValue, value) {  	this.cleanValue = cleanValue;  	this.value = value;  	this.isSelected = false;  },  simplify: function(s) {    var trimRe = /^[ \s\f\t\n\r]+|[ \s\f\t\n\r]+$/g;    var tempString = s.toLowerCase().replace(WICK.trimRe, '');  	return tempString;  },  getUserInputToMatch: function(s) {  	var a = s;  	//var fields = s.split(",");    var fields = s.split(/,|;/);  	if (fields.length > 0) {  		a = fields[fields.length - 1];    }  	return a;  },  getUserInputBase: function() {  	var s = WICK.siw.inputBox.value;  	var a = s;    var lastComma = s.lastIndexOf(",");    var lastSemicolon = s.lastIndexOf(";");  	if ( (lastComma != -1) || (lastSemicolon != -1) ) {      if(lastComma > lastSemicolon) {    		a = a.replace(/^(.*,[ \r\n\t\f\s]*).*$/i, '$1');        return a;      }      else {        a = a.replace(/^(.*;[ \r\n\t\f\s]*).*$/i, '$1');        return a;      }  	}    a = "";  	return a;  },  runMatchingLogic: function(userInput, standalone) {  	userInput = WICK.simplify(userInput);  	var uifc = userInput.charAt(0).toLowerCase();  	if (uifc == '"') {  		uifc = (n = userInput.charAt(1)) ? n.toLowerCase() : "z";    }  	if (standalone) {  		userInput = uifc;    }  	if (WICK.siw) {  		WICK.siw.matchCollection = [];    }  	var pointerToCollectionToUse = WICK.sampleData;  	if (      WICK.siw &&      WICK.siw.revisedCollection &&      (WICK.siw.revisedCollection.length > 0) &&      WICK.siw.lastUserInput &&      (userInput.indexOf(WICK.siw.lastUserInput) === 0)    ) {  		pointerToCollectionToUse = WICK.siw.revisedCollection;  	} else if (WICK.collectionIndex[userInput] && (WICK.collectionIndex[userInput].length > 0)) {  		pointerToCollectionToUse = WICK.collectionIndex[userInput];  	} else if (WICK.collectionIndex[uifc] && (WICK.collectionIndex[uifc].length > 0)) {  		pointerToCollectionToUse = WICK.collectionIndex[uifc];  	} else if (WICK.siw && (userInput.length == 1) && (!WICK.collectionIndex[uifc])) {  		WICK.siw.buildIndex = true;  	} else if (WICK.siw) {  		WICK.siw.buildIndex = false;  	}  	var tempCollection = [];  	var re1m = new RegExp("^([ \"><-]*)(" + userInput + ")", "i");  	var re2m = new RegExp("([ \"><-]+)(" + userInput + ")", "i");  	var re1 = new RegExp("^([ \"}{-]*)(" + userInput + ")", "gi");  	var re2 = new RegExp("([ \"}{-]+)(" + userInput + ")", "gi");  	for (var i = 0, j = 0; i<pointerToCollectionToUse.length; i++) {  		var displayMatches = ((!standalone) && (j < WICK.siw.MAX_MATCHES)); 		var entry = pointerToCollectionToUse[i];  		var mEntry = WICK.simplify(entry);  		if (!standalone && (mEntry.indexOf(userInput) === 0)) {  			userInput = userInput.replace(/>/gi, '\\}').replace(/< ?/gi, '\\{');  			var re = new RegExp("(" + userInput + ")", "i");  			if (displayMatches) {  				WICK.siw.matchCollection[j] =            new WICK.SmartInputMatch(entry, mEntry.replace(/>/gi, '}').replace(/< ?/gi, '{').replace(re, "<b>$1</b>"));  			}  			tempCollection[j] = entry;  			j++;  		}      else {        if (mEntry.match(re1m) || mEntry.match(re2m)) {    			if (!standalone && displayMatches) {    				WICK.siw.matchCollection[j] =              new WICK.SmartInputMatch(entry, mEntry.replace(/>/gi, '}').replace(/</gi, '{').replace(re1,	"$1<b>$2</b>").replace(re2, "$1<b>$2</b>"));    			}    			tempCollection[j] = entry;    			j++;    		}      }  	}// loop thru sample data (collection)  	if (WICK.siw) {  		WICK.siw.lastUserInput = userInput;  		WICK.siw.revisedCollection = tempCollection.join(",").split(",");  		WICK.collectionIndex[userInput] = tempCollection.join(",").split(",");  	}  	if (standalone || WICK.siw.buildIndex) {  		WICK.collectionIndex[uifc] = tempCollection.join(",").split(",");  		if (WICK.siw) {  			WICK.siw.buildIndex = false;      }  	}    //console.timeEnd("time - runMatchingLogic");  },  setSmartInputData: function() {  	if (WICK.siw) {  		var orgUserInput = WICK.siw.inputBox.value;  		orgUserInput = WICK.getUserInputToMatch(orgUserInput);  		var userInput = orgUserInput.toLowerCase().replace(/[\r\n\t\f\s]+/gi, ' ')  				.replace(/^ +/gi, '').replace(/ +$/gi, '').replace(/ +/gi, ' ')  				.replace(/\\/gi, '').replace(/\[/gi, '').replace(/\(/gi, '')  				.replace(/\./gi, '\.').replace(/\?/gi, '');  		if (userInput && (userInput !== "") && (userInput != '"')) {  			WICK.runMatchingLogic(userInput);  		}// if userinput not blank and is meaningful  		else {  			WICK.siw.matchCollection = null;  		}  	}  },  getSmartInputBoxContent: function() {  	var a = '';  	if (WICK.siw && WICK.siw.matchCollection && (WICK.siw.matchCollection.length > 0)) {  		for (var i = 0; i < WICK.siw.matchCollection.length; i++) {  			var selectedString = WICK.siw.matchCollection[i].isSelected? ' selectedSmartInputItem': '';  			a +=          '<p class="matchedSmartInputItem' +	selectedString + '">' +  				WICK.siw.matchCollection[i].value.replace(/\{ */gi, "&lt;").replace(/\} */gi, "&gt;") + '</p>';  		}  	}  	return a;  },  modifySmartInputBoxContent: function(content) {  	WICK.siw.floaterContent.dom.innerHTML = '<div id="smartInputResults">' + content + '</div>';  	//WICK.siw.matchListDisplay = document.getElementById("smartInputResults");  },  selectFromMouseOver: function(o) {  	var currentIndex = WICK.getCurrentlySelectedSmartInputItem();  	if (currentIndex !== null) {  		WICK.deSelectSmartInputMatchItem(currentIndex);    }  	var newIndex = WICK.getIndexFromElement(o);  	WICK.selectSmartInputMatchItem(newIndex);  	WICK.modifySmartInputBoxContent(WICK.getSmartInputBoxContent());  },  selectFromMouseClick: function() {  	WICK.activateCurrentSmartInputMatch();  	WICK.siw.inputBox.focus();  	WICK.hideSmartInputFloater();  },  getIndexFromElement: function(o) {  	var index = 0;  	while (o = o.previousSibling) {  		index++;  	}//  	return index;  },  getCurrentlySelectedSmartInputItem: function() {  	var answer = null;  	for (var i = 0; ((i < WICK.siw.matchCollection.length) && !answer); i++) {  		if (WICK.siw.matchCollection[i].isSelected) {  			answer = i;      }  	}  	return answer;  },  selectSmartInputMatchItem: function(index) {	if(WICK.siw.matchCollection.length !== 0)  		WICK.siw.matchCollection[index].isSelected = true;  },  deSelectSmartInputMatchItem: function(index) {  	WICK.siw.matchCollection[index].isSelected = false;  },  selectNextSmartInputMatchItem: function() {    if(WICK.siw.matchCollection === null) {      return;    }    if(typeof WICK.siw.matchCollection[0] === "undefined") {      return;    }  	var currentIndex = WICK.getCurrentlySelectedSmartInputItem();  	if (currentIndex !== null) {  		WICK.deSelectSmartInputMatchItem(currentIndex);  		if ((currentIndex + 1) < WICK.siw.matchCollection.length) {  			WICK.selectSmartInputMatchItem(currentIndex + 1);      }  		else {  			WICK.selectSmartInputMatchItem(0);      }  	}    else {  		WICK.selectSmartInputMatchItem(0);  	}  	WICK.modifySmartInputBoxContent(WICK.getSmartInputBoxContent());  },  selectPreviousSmartInputMatchItem: function() {    if( WICK.siw.matchCollection === null ) {      return;    }    if(typeof WICK.siw.matchCollection[WICK.siw.matchCollection.length - 1] === "undefined") {      return;    }  	var currentIndex = WICK.getCurrentlySelectedSmartInputItem();  	if (currentIndex !== null) {  		WICK.deSelectSmartInputMatchItem(currentIndex);  		if ((currentIndex - 1) >= 0) {  			WICK.selectSmartInputMatchItem(currentIndex - 1);      }  		else {  			WICK.selectSmartInputMatchItem(WICK.siw.matchCollection.length - 1);      }  	}    else {  		WICK.selectSmartInputMatchItem(WICK.siw.matchCollection.length - 1);  	}  	WICK.modifySmartInputBoxContent(WICK.getSmartInputBoxContent());  },  activateCurrentSmartInputMatch: function() {  	var baseValue = WICK.getUserInputBase();  	if ((selIndex = WICK.getCurrentlySelectedSmartInputItem()) !== null) {  		var addedValue = WICK.siw.matchCollection[selIndex].cleanValue;  		var theString = (baseValue ? baseValue : "") + addedValue + ", ";      //var theString = (baseValue ? baseValue : "") + addedValue;  		WICK.siw.inputBox.value = theString;  		WICK.runMatchingLogic(addedValue, true);  	}  },  SmartInputWindow: function() {  	this.customFloater = false;  	//this.floater = document.getElementById("smartInputFloater");    this.floater = Ext.get('smartInputFloater');    this.floater.removeAllListeners();    this.floater.on('mouseup', WICK.eventHandlers.handleClick, this.floater);    this.floater.on('mouseover', WICK.eventHandlers.handleMouseOver, this.floater);    this.floater.on('keydown', WICK.eventHandlers.handleKeyDown, this.floater);    this.floater.on('keyup', WICK.eventHandlers.handleKeyPress, this.floater);  	//this.floaterContent = document.getElementById("smartInputFloaterContent");    this.floaterContent = Ext.get('smartInputFloaterContent');  	this.selectedSmartInputItem = null;  	this.MAX_MATCHES = 15;  	this.isGecko = Ext.isGecko;  	this.isSafari = Ext.isSafari;  	this.isWinIE = Ext.isIE;  },  assignHandlers: function(element) {    element.on('keydown', WICK.eventHandlers.handleKeyDown);    element.on('keyup', WICK.eventHandlers.handleKeyPress);    element.on('click', WICK.eventHandlers.handleClick);    //element.on('mouseover', WICK.eventHandlers.handleMouseOver);  }};document.write('<div id="smartInputFloater" class="floater"><div id="smartInputFloaterContent"></div></div>');/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/ComboBoxMulti.js *//*--------------------------------------------------*//* * Ext JS Library 2.2 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.form.ComboBoxMulti = function(config) {	this.preventDuplicates = false;    Ext.form.ComboBoxMulti.superclass.constructor.call(this, config);};Ext.extend(Ext.form.ComboBoxMulti,  Ext.form.ComboBox, {/*	Override onRender to add template if it doesn't exist*/    // private    onRender : function(ct, position){        Ext.form.ComboBox.superclass.onRender.call(this, ct, position);        if(this.hiddenName){            this.hiddenField = this.el.insertSibling({tag:'input', type:'hidden', name: this.hiddenName,                    id: (this.hiddenId||this.hiddenName)}, 'before', true);            // prevent input submission            this.el.dom.removeAttribute('name');        }        if(Ext.isGecko){            this.el.dom.setAttribute('autocomplete', 'off');        }        if(!this.lazyInit){			if(!this.tpl)			{				this.tpl = new Ext.XTemplate(			      		'<tpl for=".">',			      			'<div class="x-combo-list-item" >{[this.format(values)]}</div>',			      		'</tpl>',			          {			          format : function(values){			              var str = Ext.util.Format.htmlEncode(this.getActiveEntry());			              if(str.length > 0){							if(str == "g"){								return values[this.displayField].replace(/"/g, "").replace(new RegExp("(" + Ext.escapeRe(str) + ")", "ig"), '<b>$1</b>');							}			                return Ext.util.Format.htmlEncode(values[this.displayField]).replace(/&quot;/g, "").replace(new RegExp("(" + Ext.escapeRe(str) + ")", "ig"), '<b>$1</b>').replace(/&quot;/g, "");			              }			              return Ext.util.Format.htmlEncode(values[this.displayField]).replace(/&quot;/g, "");			          }					}				,this);			}			            this.initList();        }else{            this.on('focus', this.initList, this, {single: true});        }    }    ,setValue : function(v){        var text = v;        if(this.valueField){            var r = this.findRecord(this.valueField, v);            if(r){                text = r.data[this.valueField];            }else if(this.valueNotFoundText !== undefined){                text = this.valueNotFoundText;            }        }        this.lastSelectionText = text;        if(this.hiddenField){            this.hiddenField.value = v;        }        Ext.form.ComboBox.superclass.setValue.call(this, text);        this.value = v;    }   // private    ,initEvents : function(){        Ext.form.ComboBox.superclass.initEvents.call(this);        this.keyNav = new Ext.KeyNav(this.el, {            "up" : function(e){                this.inKeyMode = true;                this.selectPrev();            },            "down" : function(e){                if(this.isExpanded()){                    this.inKeyMode = true;                    this.selectNext();                }            },            "enter" : function(e){                this.onViewClick();                this.delayedCheck = true;                this.unsetDelayCheck.defer(10, this);            },            "esc" : function(e){                this.collapse();            },            "tab" : function(e){                //this.onViewClick(false);				this.collapse();                return true;            },            scope : this,            doRelay : function(foo, bar, hname){                if(hname == 'down' || this.scope.isExpanded()){                   return Ext.KeyNav.prototype.doRelay.apply(this, arguments);                }                return true;            },            forceKeyDown : true        });        this.queryDelay = Math.max(this.queryDelay || 10,                this.mode == 'local' ? 10 : 250);        this.dqTask = new Ext.util.DelayedTask(this.initQuery, this);        if(this.typeAhead){            this.taTask = new Ext.util.DelayedTask(this.onTypeAhead, this);        }        if(this.editable !== false){                this.mon(this.el, 'keyup', this.onKeyUp, this);        }        if(this.forceSelection){            this.on('blur', this.doForce, this);        }    }	,getPositionZ: function() { 		return this.getRawValue().length;	}	,getActiveRange: function() {		var s = this.sep;		var p = this.getPositionZ();		var v = this.getRawValue();		var left = p		while (left > 0 && v.charAt(left) != s)			--left;		if (left > 0) left++;		return {left: left, right: p};	}	,getActiveEntry: function() {		var r = this.getActiveRange();		return this.getRawValue().substring(r.left, r.right).replace(/^\s+|\s+$/g, '');	}	,replaceActiveEntry: function(value){		var r = this.getActiveRange();		var v = this.getRawValue();		if (this.preventDuplicates && v.indexOf(value) >= 0) {			return;		}		var pad = (this.sep == ' ' ? '' : ' ');		this.setValue(v.substring(0, r.left) + (r.left > 0 ? pad : '') + value + this.sep + pad + v.substring(r.right));		var p = r.left + value.length + 2 + pad.length;		this.selectText.defer(200, this, [p, p]);	}	// private	,onSelect : function(record, index){		if(this.fireEvent('beforeselect', this, record, index) !== false){			var value = record.data[this.valueField || this.displayField];			if (this.sep) {				this.replaceActiveEntry(value);			} else {				this.setValue(value);			}						this.collapse();			this.fireEvent('select', this, record, index);		}	}	// private	,initQuery : function(){		if(this.sep && this.getActiveEntry().indexOf("@") != -1 || !this.store)		  return;	  	if(this.getActiveEntry().trim().length == 0){			this.list.hide();			return;		}				this.doQuery(this.sep ?  this.getActiveEntry() : this.getRawValue());	}	// private	,onLoad : function(){	  if(!this.hasFocus){		  return;	  }	  if(this.store.getCount() > 0){		  this.expand();		  this.restrictHeight();		  if(this.lastQuery == this.allQuery){			  if(this.editable){				  //this.el.dom.select();			  }			  if(!this.selectByValue(this.value, true)){				  this.select(0, true);			  }		  }else{			  this.selectNext();			  if(this.typeAhead && this.lastKey != Ext.EventObject.BACKSPACE && this.lastKey != Ext.EventObject.DELETE){				  this.taTask.delay(this.typeAheadDelay);			  }		  }	  }else{		  this.onEmptyResults();	  }	  //this.el.focus();	}	,doQuery : function(q, forceAll){		if(q === undefined || q === null){			q = '';		}		var qe = {			query: q,			forceAll: forceAll,			combo: this,			cancel:false		};		if(this.fireEvent('beforequery', qe)===false || qe.cancel){			return false;		}		q = qe.query;		forceAll = qe.forceAll;		if(forceAll === true || (q.length >= this.minChars)){			if(this.lastQuery !== q){				this.lastQuery = q;				if(this.mode == 'local'){					this.selectedIndex = -1;					if(forceAll){						this.store.clearFilter();					}else{						//this.store.filter(this.displayField, q, true);						this.store.filterBy(this.filterByFn, this);					}					this.onLoad();				}else{					this.store.baseParams[this.queryParam] = q;					this.store.load({						params: this.getParams(q)					});					this.expand();				}			}else{				this.selectedIndex = -1;				this.onLoad();			}		}	}});/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/RowExpander.js *//*--------------------------------------------------*//* * Ext JS Library 2.2 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com *  * http://extjs.com/license */// Extended by: KhashayarExt.grid.RowExpander = function(config) {    Ext.apply(this, config);    this.addEvents({        beforeexpand 	: true,        expand			: true,        beforecollapse	: true,        collapse		: true    });    Ext.grid.RowExpander.superclass.constructor.call(this);    if(this.tpl){        if(typeof this.tpl == 'string'){            this.tpl = new Ext.Template(this.tpl);        }        this.tpl.compile();    }    this.state = {};    this.bodyContent = {};};Ext.extend(Ext.grid.RowExpander, Ext.util.Observable, {    header			: ""    ,width			: 20    ,sortable		: false    ,fixed			: true    ,menuDisabled	: true    ,dataIndex		: ''    ,id				: 'expander'    ,lazyRender		: true    ,enableCaching	: true    ,getRowClass : function(record, rowIndex, p, ds){        p.cols = p.cols-1;        var content = this.bodyContent[record.id];        if(!content && !this.lazyRender){            content = this.getBodyContent(record, rowIndex);        }        if(content){            p.body = content;        }                customClass = '';        if (this.grid.view.getRowCustomClass)        	customClass = this.grid.view.getRowCustomClass(record, rowIndex, p, ds);        return (this.state[record.id] ? 'x-grid3-row-expanded' : 'x-grid3-row-collapsed') + (customClass ? ' ' + customClass : '');    }    ,init : function(grid){        this.grid = grid;		        var view = grid.getView();        view.getRowClass = this.getRowClass.createDelegate(this);        view.enableRowBody = true;        grid.on('render', function(){            view.mainBody.on('mousedown', this.onMouseDown, this);        }, this);		// Added by Khashayar				grid.getStore().on("remove", function(ds, rec, idx) {			delete this.state[rec.id];		}, this)		    }    ,getBodyContent : function(record, index){        if(!this.enableCaching){            return this.tpl.apply(record.data);        }        var content = this.bodyContent[record.id];        if(!content){            content = this.tpl.apply(record.data);            this.bodyContent[record.id] = content;        }        return content;    }    ,onMouseDown : function(e, t) {        if(t.className == 'x-grid3-row-expander') {            e.stopEvent();            var row = e.getTarget('.x-grid3-row');            this.toggleRow(row);        }    }    ,renderer : function(v, p, record) {		p.cellAttr = 'rowspan="2"';		return '<div class="x-grid3-row-expander">&#160;</div>';    }    ,beforeExpand : function(record, body, rowIndex){        if(this.fireEvent('beforeexpand', this, record, body, rowIndex) !== false){            if(this.tpl && this.lazyRender) {                body.innerHTML = this.getBodyContent(record, rowIndex);            }            return true;        }else{            return false;        }    }    ,toggleRow : function(row) {        if(typeof row == 'number') {            row = this.grid.view.getRow(row);        }        this[Ext.fly(row).hasClass('x-grid3-row-collapsed') ? 'expandRow' : 'collapseRow'](row);    }    ,expandAll : function() {        var aRows = this.grid.getView().getRows();        for(var i = 0; i < aRows.length; i++) {            this.expandRow(aRows[i]);        }    }    ,collapseAll : function() {        var aRows = this.grid.getView().getRows();        for(var i = 0; i < aRows.length; i++) {            this.collapseRow(aRows[i]);        }    }            ,expandRow : function(row){        if(typeof row == 'number'){            row = this.grid.view.getRow(row);        }        var record = this.grid.store.getAt(row.rowIndex);        var body = Ext.DomQuery.selectNode('tr:nth(2) div.x-grid3-row-body', row);        if(this.beforeExpand(record, body, row.rowIndex)){            this.state[record.id] = true;            Ext.fly(row).replaceClass('x-grid3-row-collapsed', 'x-grid3-row-expanded');            this.fireEvent('expand', this, record, body, row.rowIndex);        }    }    ,collapseRow : function(row){        if(typeof row == 'number'){            row = this.grid.view.getRow(row);        }        var record = this.grid.store.getAt(row.rowIndex);        var body = Ext.fly(row).child('tr:nth(1) div.x-grid3-row-body', true);        if(this.fireEvent('beforecollapse', this, record, body, row.rowIndex) !== false){            this.state[record.id] = false;            Ext.fly(row).replaceClass('x-grid3-row-expanded', 'x-grid3-row-collapsed');            this.fireEvent('collapse', this, record, body, row.rowIndex);        }    }});/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/TreeCheckNode.js *//*--------------------------------------------------*//* Extending/depending on:~ = modified function (when updating from SVN be sure to check these for changes, especially to Ext.tree.TreeNodeUI.render() )+ = added functionTreeSelectionModel.js	Ext.tree.CheckNodeMultiSelectionModel : ~init(), ~onNodeClick(), +extendSelection(), ~onKeyDown()TreeNodeUI.js	Ext.tree.CheckboxNodeUI : ~render(), +checked(), +check(), +toggleCheck()TreePanel.js	Ext.tree.TreePanel : +getChecked()TreeLoader.js	Ext.tree.TreeLoader : ~createNode()*//** * Retrieve an array of ids of checked nodes * @return {Array} array of ids of checked nodes */Ext.tree.TreePanel.prototype.getChecked = function(node){	var checked = [], i;	if( typeof node == 'undefined' ) {		node = this.rootVisible ? this.getRootNode() : this.getRootNode().firstChild;	}	if( node.attributes.checked ) {		checked.push(node.id);		if( !node.isLeaf() ) {			for( i = 0; i < node.childNodes.length; i++ ) {				checked = checked.concat( this.getChecked(node.childNodes[i]) );			}		}	}	return checked;};/** * @class Ext.tree.CustomUITreeLoader * @extends Ext.tree.TreeLoader * Overrides createNode to force uiProvider to be an arbitrary TreeNodeUI to save bandwidth */Ext.tree.CustomUITreeLoader = function() {	Ext.tree.CustomUITreeLoader.superclass.constructor.apply(this, arguments);};Ext.extend(Ext.tree.CustomUITreeLoader, Ext.tree.TreeLoader, {	createNode : function(attr){		Ext.apply(attr, this.baseAttr || {});		if(this.applyLoader !== false){			attr.loader = this;		}		if(typeof attr.uiProvider == 'string'){			attr.uiProvider = this.uiProviders[attr.uiProvider] || eval(attr.uiProvider);		}		return(attr.leaf ?			new Ext.tree.TreeNode(attr) :				new Ext.tree.AsyncTreeNode(attr));	}});/** * @class Ext.tree.CheckboxNodeUI * @extends Ext.tree.TreeNodeUI * Adds a checkbox to all nodes */Ext.tree.CheckboxNodeUI = function() {	Ext.tree.CheckboxNodeUI.superclass.constructor.apply(this, arguments);};Ext.extend(Ext.tree.CheckboxNodeUI, Ext.tree.TreeNodeUI, {	/**	 * This is virtually identical to Ext.tree.TreeNodeUI.render, modifications are indicated inline	 */	render : function(bulkRender){		var n = this.node;		var targetNode = n.parentNode ?			n.parentNode.ui.getContainer() : n.ownerTree.container.dom; /* in later svn builds this changes to n.ownerTree.innerCt.dom */		if(!this.rendered){			this.rendered = true;			var a = n.attributes;			// add some indent caching, this helps performance when rendering a large tree			this.indentMarkup = "";			if(n.parentNode){				this.indentMarkup = n.parentNode.ui.getChildIndent();			}			// modification: added checkbox			var buf = ['<li class="x-tree-node"><div class="x-tree-node-el ', n.attributes.cls,'">',				'<span class="x-tree-node-indent">',this.indentMarkup,"</span>",				'<img src="', this.emptyIcon, '" class="x-tree-ec-icon">',				'<img src="', a.icon || this.emptyIcon, '" class="x-tree-node-icon',(a.icon ? " x-tree-node-inline-icon" : ""),(a.iconCls ? " "+a.iconCls : ""),'" unselectable="on">',				'<input class="l-tcb" type="checkbox" ', (a.checked ? "checked>" : '>'),				'<a hidefocus="on" href="',a.href ? a.href : "#",'" ',				 a.hrefTarget ? ' target="'+a.hrefTarget+'"' : "", '>',				 '<span unselectable="on">',n.text,"</span></a></div>",				'<ul class="x-tree-node-ct" style="display:none;"></ul>',				"</li>"];			if(bulkRender !== true && n.nextSibling && n.nextSibling.ui.getEl()){				this.wrap = Ext.DomHelper.insertHtml("beforeBegin",															n.nextSibling.ui.getEl(), buf.join(""));			}else{				this.wrap = Ext.DomHelper.insertHtml("beforeEnd", targetNode, buf.join(""));			}			this.elNode = this.wrap.childNodes[0];			this.ctNode = this.wrap.childNodes[1];			var cs = this.elNode.childNodes;			this.indentNode = cs[0];			this.ecNode = cs[1];			this.iconNode = cs[2];			this.checkbox = cs[3]; // modification: inserted checkbox			this.anchor = cs[4];			this.textNode = cs[4].firstChild;			if(a.qtip){			 if(this.textNode.setAttributeNS){				 this.textNode.setAttributeNS("ext", "qtip", a.qtip);				 if(a.qtipTitle){					 this.textNode.setAttributeNS("ext", "qtitle", a.qtipTitle);				 }			 }else{				 this.textNode.setAttribute("ext:qtip", a.qtip);				 if(a.qtipTitle){					 this.textNode.setAttribute("ext:qtitle", a.qtipTitle);				 }			 }			} else if(a.qtipCfg) {				a.qtipCfg.target = Ext.id(this.textNode);				Ext.QuickTips.register(a.qtipCfg);			}			this.initEvents();			// modification: Add additional handlers here to avoid modifying Ext.tree.TreeNodeUI			Ext.fly(this.checkbox).on('click', this.check.createDelegate(this, [null]));			n.on('dblclick', function(e) {				if( this.isLeaf() ) {					this.getUI().toggleCheck();				}			});			if(!this.node.expanded){				this.updateExpandIcon();			}		}else{			if(bulkRender === true) {				targetNode.appendChild(this.wrap);			}		}	},	checked : function() {		return this.checkbox.checked;	},	/**	 * Sets a checkbox appropriately.  By default only walks down through child nodes	 * if called with no arguments (onchange event from the checkbox), otherwise	 * it's assumed the call is being made programatically and the correct arguments are provided.	 * @param {Boolean} state true to check the checkbox, false to clear it. (defaults to the opposite of the checkbox.checked)	 * @param {Boolean} descend true to walk through the nodes children and set their checkbox values. (defaults to false)	 */	check : function(state, descend, bulk) {		var n = this.node;		var tree = n.getOwnerTree();		var parentNode = n.parentNode;n		if( !n.expanded && !n.childrenRendered ) {			n.expand(false, false, this.check.createDelegate(this, arguments));		}		if( typeof bulk == 'undefined' ) {			bulk = false;		}		if( typeof state == 'undefined' || state === null ) {			state = this.checkbox.checked;			descend = !state;			if( state ) {				n.expand(false, false);			}		} else {			this.checkbox.checked = state;		}		n.attributes.checked = state;		// do we have parents?		if( parentNode !== null && state ) {			// if we're checking the box, check it all the way up			if( parentNode.getUI().check ) {				parentNode.getUI().check(state, false, true);			}		}		if( descend && !n.isLeaf() ) {			var cs = n.childNodes;      for(var i = 0; i < cs.length; i++) {      	cs[i].getUI().check(state, true, true);      }		}		if( !bulk ) {			tree.fireEvent('check', n, state);		}	},	toggleCheck : function(state) {		this.check(!this.checkbox.checked, true);	}});/** * @class Ext.tree.CheckNodeMultiSelectionModel * @extends Ext.tree.MultiSelectionModel * Multi selection for a TreePanel containing Ext.tree.CheckboxNodeUI. * Adds enhanced selection routines for selecting multiple items * and key processing to check/clear checkboxes. */Ext.tree.CheckNodeMultiSelectionModel = function(){   Ext.tree.CheckNodeMultiSelectionModel.superclass.constructor.call(this);};Ext.extend(Ext.tree.CheckNodeMultiSelectionModel, Ext.tree.MultiSelectionModel, {	init : function(tree){		this.tree = tree;		tree.el.on("keydown", this.onKeyDown, this);		tree.on("click", this.onNodeClick, this);	},	/**	 * Handle a node click	 * If ctrl key is down and node is selected will unselect the node.	 * If the shift key is down it will create a contiguous selection	 * (see {@link Ext.tree.CheckNodeMultiSelectionModel#extendSelection} for the limitations)	 */	onNodeClick : function(node, e){		if( e.shiftKey && this.extendSelection(node) ) {			return true;		}		if( e.ctrlKey && this.isSelected(node) ) {			this.unselect(node);		} else {			this.select(node, e, e.ctrlKey);		}	},	/**	 * Selects all nodes between the previously selected node and the one that the user has just selected.	 * Will not span multiple depths, so only children of the same parent will be selected.	 */	extendSelection : function(node) {		var last = this.lastSelNode;		if( node == last || !last ) {			return false; /* same selection, process normally normally */		}		if( node.parentNode == last.parentNode ) {			var cs = node.parentNode.childNodes;			var i = 0, attr='id', selecting=false, lastSelect=false;			this.clearSelections(true);			for( i = 0; i < cs.length; i++ ) {				// We have to traverse the entire tree b/c don't know of a way to find				// a numerical representation of a nodes position in a tree.				if( cs[i].attributes[attr] == last.attributes[attr] || cs[i].attributes[attr] == node.attributes[attr] ) {					// lastSelect ensures that we select the final node in the list					lastSelect = selecting;					selecting = !selecting;				}				if( selecting || lastSelect ) {					this.select(cs[i], null, true);					// if we're selecting the last node break to avoid traversing the entire tree					if( lastSelect ) {						break;					}				}			}			return true;		} else {			return false;		}	},	/**	 * Traps the press of the SPACE bar and sets the check state of selected nodes to the opposite state of	 * the selected or last selected node.  Assume you have the following five Ext.tree.CheckboxNodeUIs:	 * [X] One, [X] Two, [X] Three, [ ] Four, [ ] Five	 * If you select them in this order: One, Two, Three, Four, Five and press the space bar they all	 * will be <b>checked</b> (the opposite of the checkbox state of Five).	 * If you select them in this order: Five, Four, Three, Two, One and press the space bar they all	 * will be <b>unchecked</b> which is the opposite of the checkbox state of One.	 */	onKeyDown : Ext.tree.DefaultSelectionModel.prototype.onKeyDown.createInterceptor(function(e) {		var s = this.selNode || this.lastSelNode;		// undesirable, but required		var sm = this;		if(!s){			return;		}		var k = e.getKey();		switch(k){				case e.SPACE:					e.stopEvent();					var sel = this.getSelectedNodes();					var state = !s.getUI().checked();					if( sel.length == 1 ) {						s.getUI().check(state, !s.isLeaf());					} else {						for( var i = 0; i < sel.length; i++ ) {							sel[i].getUI().check(state, !sel[i].isLeaf() );						}					}			break;		}		return true;	})});/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/tools.js *//*--------------------------------------------------*//* * Ext JS Library 2.0.1 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com *  * http://extjs.com/license */Ext.tools = function(){    var msgCt;    function createBox(t, s){        return ['<div class="msg">',                '<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>',                '<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc"><h3>', t, '</h3>', s, '</div></div></div>',                '<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>',                '</div>'].join('');    }    return {        msg : function(title, format, d) {			var delay = d || 3;            if(!msgCt){                msgCt = Ext.DomHelper.insertFirst(document.body, {id:'msg-div'}, true);            }            msgCt.alignTo(document, 't-t');            var s = String.format.apply(String, Array.prototype.slice.call(arguments, 1));            var m = Ext.DomHelper.append(msgCt, {html:createBox(title, s)}, true);            m.slideIn('t').pause(delay).ghost("t", {remove:true});        },        init : function(){            var t = Ext.get('exttheme');            if(!t){ // run locally?                return;            }            var theme = Cookies.get('exttheme') || 'aero';            if(theme){                t.dom.value = theme;                Ext.getBody().addClass('x-'+theme);            }            t.on('change', function(){                Cookies.set('exttheme', t.getValue());                setTimeout(function(){                    window.location.reload();                }, 250);            });            var lb = Ext.get('lib-bar');            if(lb){                lb.show();            }        }    };}();Ext.tools.shortBogusMarkup = '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.';Ext.tools.bogusMarkup = '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.<br/><br/>Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit.</p>';Ext.onReady(Ext.tools.init, Ext.tools);// old school cookie functions grabbed off the webvar Cookies = {};Cookies.set = function(name, value){     var argv = arguments;     var argc = arguments.length;     var expires = (argc > 2) ? argv[2] : null;     var path = (argc > 3) ? argv[3] : '/';     var domain = (argc > 4) ? argv[4] : null;     var secure = (argc > 5) ? argv[5] : false;     document.cookie = name + "=" + escape (value) +       ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +       ((path == null) ? "" : ("; path=" + path)) +       ((domain == null) ? "" : ("; domain=" + domain)) +       ((secure == true) ? "; secure" : "");};Cookies.get = function(name){	var arg = name + "=";	var alen = arg.length;	var clen = document.cookie.length;	var i = 0;	var j = 0;	while(i < clen){		j = i + alen;		if (document.cookie.substring(i, j) == arg)			return Cookies.getCookieVal(j);		i = document.cookie.indexOf(" ", i) + 1;		if(i == 0)			break;	}	return null;};Cookies.clear = function(name) {  if(Cookies.get(name)){    document.cookie = name + "=" +    "; expires=Thu, 01-Jan-70 00:00:01 GMT";  }};Cookies.getCookieVal = function(offset){   var endstr = document.cookie.indexOf(";", offset);   if(endstr == -1){       endstr = document.cookie.length;   }   return unescape(document.cookie.substring(offset, endstr));};/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/SearchBox.js *//*--------------------------------------------------*/Ext.app.SearchField = Ext.extend(Ext.form.TwinTriggerField, {    initComponent : function(){        if(!this.store.baseParams){			this.store.baseParams = {};		}		Ext.app.SearchField.superclass.initComponent.call(this);		this.on('specialkey', function(f, e){            if(e.getKey() == e.ENTER){                this.onTrigger2Click();            }        }, this);    },    validationEvent:false,    validateOnBlur:false,    trigger1Class:'x-form-clear-trigger',    trigger2Class:'x-form-search-trigger',    hideTrigger1:true,    width:180,    hasSearch : false,    paramName : 'query',    onTrigger1Click : function(){        if(this.hasSearch){            this.store.baseParams[this.paramName] = '';			this.store.removeAll();			this.el.dom.value = '';            this.triggers[0].hide();            this.hasSearch = false;			this.focus();        }    },    onTrigger2Click : function(){        var v = this.getRawValue();        if(v.length < 1){            this.onTrigger1Click();            return;        }		if(v.length < 2){			Ext.Msg.alert('Invalid Search', 'You must enter a minimum of 2 characters to search');			return;		}		this.store.baseParams[this.paramName] = v;        var o = {start: 0};        this.store.reload({params:o});        this.hasSearch = true;        this.triggers[0].show();		this.focus();    }});/** * Makes a ComboBox more closely mimic an HTML SELECT.  Supports clicking and dragging * through the list, with item selection occurring when the mouse button is released. * When used will automatically set {@link #editable} to false and call {@link Ext.Element#unselectable} * on inner elements.  Re-enabling editable after calling this will NOT work. * * @author Corey Gilmore * http://extjs.com/forum/showthread.php?t=6392 * * @history 2007-07-08 jvs * Slight mods for Ext 2.0 */Ext.ux.SelectBox = function(config){	this.searchResetDelay = 1000;	config = config || {};	config = Ext.apply(config || {}, {		editable: false,		forceSelection: true,		rowHeight: false,		lastSearchTerm: false,        triggerAction: 'all',        mode: 'local'    });	Ext.ux.SelectBox.superclass.constructor.apply(this, arguments);	this.lastSelectedIndex = this.selectedIndex || 0;};Ext.extend(Ext.ux.SelectBox, Ext.form.ComboBox, {    lazyInit: false,	initEvents : function(){		Ext.ux.SelectBox.superclass.initEvents.apply(this, arguments);		// you need to use keypress to capture upper/lower case and shift+key, but it doesn't work in IE		this.el.on('keydown', this.keySearch, this, true);		this.cshTask = new Ext.util.DelayedTask(this.clearSearchHistory, this);	},	keySearch : function(e, target, options) {		var raw = e.getKey();		var key = String.fromCharCode(raw);		var startIndex = 0;		if( !this.store.getCount() ) {			return;		}		switch(raw) {			case Ext.EventObject.HOME:				e.stopEvent();				this.selectFirst();				return;			case Ext.EventObject.END:				e.stopEvent();				this.selectLast();				return;			case Ext.EventObject.PAGEDOWN:				this.selectNextPage();				e.stopEvent();				return;			case Ext.EventObject.PAGEUP:				this.selectPrevPage();				e.stopEvent();				return;		}		// skip special keys other than the shift key		if( (e.hasModifier() && !e.shiftKey) || e.isNavKeyPress() || e.isSpecialKey() ) {			return;		}		if( this.lastSearchTerm == key ) {			startIndex = this.lastSelectedIndex;		}		this.search(this.displayField, key, startIndex);		this.cshTask.delay(this.searchResetDelay);	},	onRender : function(ct, position) {		this.store.on('load', this.calcRowsPerPage, this);		Ext.ux.SelectBox.superclass.onRender.apply(this, arguments);		if( this.mode == 'local' ) {			this.calcRowsPerPage();		}	},	onSelect : function(record, index, skipCollapse){		if(this.fireEvent('beforeselect', this, record, index) !== false){			this.setValue(record.data[this.valueField || this.displayField]);			if( !skipCollapse ) {				this.collapse();			}			this.lastSelectedIndex = index + 1;			this.fireEvent('select', this, record, index);		}	},	render : function(ct) {		Ext.ux.SelectBox.superclass.render.apply(this, arguments);		if( Ext.isSafari ) {			this.el.swallowEvent('mousedown', true);		}		this.el.unselectable();		this.innerList.unselectable();		this.trigger.unselectable();		this.innerList.on('mouseup', function(e, target, options) {			if( target.id && target.id == this.innerList.id ) {				return;			}			this.onViewClick();		}, this);		this.innerList.on('mouseover', function(e, target, options) {			if( target.id && target.id == this.innerList.id ) {				return;			}			this.lastSelectedIndex = this.view.getSelectedIndexes()[0] + 1;			this.cshTask.delay(this.searchResetDelay);		}, this);		this.trigger.un('click', this.onTriggerClick, this);		this.trigger.on('mousedown', function(e, target, options) {			e.preventDefault();			this.onTriggerClick();		}, this);		this.on('collapse', function(e, target, options) {			Ext.getDoc().un('mouseup', this.collapseIf, this);		}, this, true);		this.on('expand', function(e, target, options) {			Ext.getDoc().on('mouseup', this.collapseIf, this);		}, this, true);	},	clearSearchHistory : function() {		this.lastSelectedIndex = 0;		this.lastSearchTerm = false;	},	selectFirst : function() {		this.focusAndSelect(this.store.data.first());	},	selectLast : function() {		this.focusAndSelect(this.store.data.last());	},	selectPrevPage : function() {		if( !this.rowHeight ) {			return;		}		var index = Math.max(this.selectedIndex-this.rowsPerPage, 0);		this.focusAndSelect(this.store.getAt(index));	},	selectNextPage : function() {		if( !this.rowHeight ) {			return;		}		var index = Math.min(this.selectedIndex+this.rowsPerPage, this.store.getCount() - 1);		this.focusAndSelect(this.store.getAt(index));	},	search : function(field, value, startIndex) {		field = field || this.displayField;		this.lastSearchTerm = value;		var index = this.store.find.apply(this.store, arguments);		if( index !== -1 ) {			this.focusAndSelect(index);		}	},	focusAndSelect : function(record) {		var index = typeof record === 'number' ? record : this.store.indexOf(record);		this.select(index, this.isExpanded());		this.onSelect(this.store.getAt(record), index, this.isExpanded());	},	calcRowsPerPage : function() {		if( this.store.getCount() ) {			this.rowHeight = Ext.fly(this.view.getNode(0)).getHeight();			this.rowsPerPage = this.maxHeight / this.rowHeight;		} else {			this.rowHeight = false;		}	}});/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/DDView.js *//*--------------------------------------------------*/Array.prototype.contains = function(element) {	return this.indexOf(element) !== -1;};Ext.namespace("Ext.ux"); /**  * @class Ext.ux.DDView  * A DnD enabled version of Ext.View.  * @param {Element/String} container The Element in which to create the View.  * @param {String} tpl The template string used to create the markup for each element of the View  * @param {Object} config The configuration properties. These include all the config options of  * {@link Ext.View} plus some specific to this class.<br>  * <p>  * Drag/drop is implemented by adding {@link Ext.data.Record}s to the target DDView. If copying is  * not being performed, the original {@link Ext.data.Record} is removed from the source DDView.<br>  * <p>  * The following extra CSS rules are needed to provide insertion point highlighting:<pre><code> .x-view-drag-insert-above {     border-top:1px dotted #3366cc; } .x-view-drag-insert-below {     border-bottom:1px dotted #3366cc; } </code></pre>  *   */ Ext.ux.DDView = function(config) {	if (!config.itemSelector) {		var tpl = config.tpl;		if (this.classRe.test(tpl)) {			config.tpl = tpl.replace(this.classRe, 'class=$1x-combo-list-item $2$1');		}		else {			config.tpl = tpl.replace(this.tagRe, '$1 class="x-combo-list-item" $2');		}		config.itemSelector = ".x-combo-list-item";	}    Ext.ux.DDView.superclass.constructor.call(this, Ext.apply(config, {         border: false     })); }; Ext.extend(Ext.ux.DDView, Ext.DataView, { /**    @cfg {String/Array} dragGroup The ddgroup name(s) for the View's DragZone. */ /**    @cfg {String/Array} dropGroup The ddgroup name(s) for the View's DropZone. */ /**    @cfg {Boolean} copy Causes drag operations to copy nodes rather than move. */ /**    @cfg {Boolean} allowCopy Causes ctrl/drag operations to copy nodes rather than move. */ 	sortDir: 'ASC',    isFormField: true,          classRe: /class=(['"])(.*)\1/,     tagRe: /(<\w*)(.*?>)/,     reset: Ext.emptyFn,          clearInvalid: Ext.form.Field.prototype.clearInvalid,     msgTarget: 'qtip', 	afterRender: function() {		Ext.ux.DDView.superclass.afterRender.call(this);	    if (this.dragGroup) { 	        this.setDraggable(this.dragGroup.split(",")); 	    } 	    if (this.dropGroup) { 	        this.setDroppable(this.dropGroup.split(",")); 	    } 	    if (this.deletable) { 	        this.setDeletable(); 	    } 	    this.isDirtyFlag = false; 	    this.addEvents( 	        "drop" 	    );	},         validate: function() {         return true;     },          destroy: function() {         this.purgeListeners();         this.getEl().removeAllListeners();         this.getEl().remove();         if (this.dragZone) {             if (this.dragZone.destroy) {                 this.dragZone.destroy();             }         }         if (this.dropZone) {             if (this.dropZone.destroy) {                 this.dropZone.destroy();             }         }     }, /**    Allows this class to be an Ext.form.Field so it can be found using {@link Ext.form.BasicForm#findField}. */     getName: function() {         return this.name;     }, /**    Loads the View from a JSON string representing the Records to put into the Store. */     setValue: function(v) {         if (!this.store) {             throw "DDView.setValue(). DDView must be constructed with a valid Store";         }         var data = {};         data[this.store.reader.meta.root] = v ? [].concat(v) : [];         this.store.proxy = new Ext.data.MemoryProxy(data);         this.store.load();     }, /**    @return {String} a parenthesised list of the ids of the Records in the View. */     getValue: function() {         var result = '(';         this.store.each(function(rec) {             result += rec.id + ',';         });         return result.substr(0, result.length - 1) + ')';     },          getIds: function() {         var i = 0, result = new Array(this.store.getCount());         this.store.each(function(rec) {             result[i++] = rec.id;         });         return result;     },          isDirty: function() {         return this.isDirtyFlag;     }, /**  *    Part of the Ext.dd.DropZone interface. If no target node is found, the  *    whole Element becomes the target, and this causes the drop gesture to append.  */     getTargetFromEvent : function(e) {         var target = e.getTarget();         while ((target !== null) && (target.parentNode != this.el.dom)) {             target = target.parentNode;         }         if (!target) {             target = this.el.dom.lastChild || this.el.dom;         }         return target;     }, /**  *    Create the drag data which consists of an object which has the property "ddel" as  *    the drag proxy element.   */     getDragData : function(e) {         var target = this.findItemFromChild(e.getTarget());         if(target) {             if (!this.isSelected(target)) {                 delete this.ignoreNextClick;                 this.onItemClick(target, this.indexOf(target), e);                 this.ignoreNextClick = true;             }             var dragData = {                 sourceView: this,                 viewNodes: [],                 records: [],                 copy: this.copy || (this.allowCopy && e.ctrlKey)             };             if (this.getSelectionCount() == 1) {                 var i = this.getSelectedIndexes()[0];                 var n = this.getNode(i);                 dragData.viewNodes.push(dragData.ddel = n);                 dragData.records.push(this.store.getAt(i));                 dragData.repairXY = Ext.fly(n).getXY();             } else {                 dragData.ddel = document.createElement('div');                 dragData.ddel.className = 'multi-proxy';                 this.collectSelection(dragData);             }             return dragData;         }         return false;     }, //    override the default repairXY.     getRepairXY : function(e){         return this.dragData.repairXY;     }, /**    Put the selections into the records and viewNodes Arrays. */     collectSelection: function(data) {         data.repairXY = Ext.fly(this.getSelectedNodes()[0]).getXY();         if (this.preserveSelectionOrder === true) {             Ext.each(this.getSelectedIndexes(), function(i) {                 var n = this.getNode(i);                 var dragNode = n.cloneNode(true);                 dragNode.id = Ext.id();                 data.ddel.appendChild(dragNode);                 data.records.push(this.store.getAt(i));                 data.viewNodes.push(n);             }, this);         } else {             var i = 0;             this.store.each(function(rec){                 if (this.isSelected(i)) {                     var n = this.getNode(i);                     var dragNode = n.cloneNode(true);                     dragNode.id = Ext.id();                     data.ddel.appendChild(dragNode);                     data.records.push(this.store.getAt(i));                     data.viewNodes.push(n);                 }                 i++;             }, this);         }     },      /**    Specify to which ddGroup items in this DDView may be dragged. */     setDraggable: function(ddGroup) {         if (ddGroup instanceof Array) {             Ext.each(ddGroup, this.setDraggable, this);             return;         }         if (this.dragZone) {             this.dragZone.addToGroup(ddGroup);         } else {             this.dragZone = new Ext.dd.DragZone(this.getEl(), {                 containerScroll: true,                 ddGroup: ddGroup             }); //            Draggability implies selection. DragZone's mousedown selects the element.             if (!this.multiSelect) { this.singleSelect = true; } //            Wire the DragZone's handlers up to methods in *this*             this.dragZone.getDragData = this.getDragData.createDelegate(this);             this.dragZone.getRepairXY = this.getRepairXY;             this.dragZone.onEndDrag = this.onEndDrag;         }     }, /**    Specify from which ddGroup this DDView accepts drops. */     setDroppable: function(ddGroup) {         if (ddGroup instanceof Array) {             Ext.each(ddGroup, this.setDroppable, this);             return;         }         if (this.dropZone) {             this.dropZone.addToGroup(ddGroup);         } else {             this.dropZone = new Ext.dd.DropZone(this.getEl(), {                 owningView: this,                 containerScroll: true,                 ddGroup: ddGroup             }); //            Wire the DropZone's handlers up to methods in *this*             this.dropZone.getTargetFromEvent = this.getTargetFromEvent.createDelegate(this);             this.dropZone.onNodeEnter = this.onNodeEnter.createDelegate(this);             this.dropZone.onNodeOver = this.onNodeOver.createDelegate(this);             this.dropZone.onNodeOut = this.onNodeOut.createDelegate(this);             this.dropZone.onNodeDrop = this.onNodeDrop.createDelegate(this);         }     }, /**    Decide whether to drop above or below a View node. */     getDropPoint : function(e, n, dd){         if (n == this.el.dom) { return "above"; }         var t = Ext.lib.Dom.getY(n), b = t + n.offsetHeight;         var c = t + (b - t) / 2;         var y = Ext.lib.Event.getPageY(e);         if(y <= c) {             return "above";         }else{             return "below";         }     },          isValidDropPoint: function(pt, n, data) {         if (!data.viewNodes || (data.viewNodes.length != 1)) {             return true;         }         var d = data.viewNodes[0];         if (d == n) {             return false;         }         if ((pt == "below") && (n.nextSibling == d)) {             return false;         }         if ((pt == "above") && (n.previousSibling == d)) {             return false;         }         return true;     },     onNodeEnter : function(n, dd, e, data){    	if (this.highlightColor && (data.sourceView != this)) {	    	this.el.highlight(this.highlightColor);	    }        return false;     },          onNodeOver : function(n, dd, e, data){         var dragElClass = this.dropNotAllowed;         var pt = this.getDropPoint(e, n, dd);         if (this.isValidDropPoint(pt, n, data)) {     		if (this.appendOnly || this.sortField) {    			return "x-tree-drop-ok-below";    		}//            set the insert point style on the target node             if (pt) {                 var targetElClass;                 if (pt == "above"){                     dragElClass = n.previousSibling ? "x-tree-drop-ok-between" : "x-tree-drop-ok-above";                     targetElClass = "x-view-drag-insert-above";                 } else {                     dragElClass = n.nextSibling ? "x-tree-drop-ok-between" : "x-tree-drop-ok-below";                     targetElClass = "x-view-drag-insert-below";                 }                 if (this.lastInsertClass != targetElClass){                     Ext.fly(n).replaceClass(this.lastInsertClass, targetElClass);                     this.lastInsertClass = targetElClass;                 }             }         }         return dragElClass;     },     onNodeOut : function(n, dd, e, data){         this.removeDropIndicators(n);     },     onNodeDrop : function(n, dd, e, data){        if (this.fireEvent("drop", this, n, dd, e, data) === false) {            return false;         }        var pt = this.getDropPoint(e, n, dd);         var insertAt = (this.appendOnly || (n == this.el.dom)) ? this.store.getCount() : n.viewIndex;         if (pt == "below") {             insertAt++;         } //        Validate if dragging within a DDView         if (data.sourceView == this) {//            If the first element to be inserted below is the target node, remove it             if (pt == "below") {                 if (data.viewNodes[0] == n) {                     data.viewNodes.shift();                 }             } else { //    If the last element to be inserted above is the target node, remove it                 if (data.viewNodes[data.viewNodes.length - 1] == n) {                     data.viewNodes.pop();                 }             }      //            Nothing to drop...             if (!data.viewNodes.length) {                 return false;             } //            If we are moving DOWN, then because a store.remove() takes place first, //            the insertAt must be decremented.             if (insertAt > this.store.indexOf(data.records[0])) {                 insertAt--;             }         } //        Dragging from a Tree. Use the Tree's recordFromNode function.         if (data.node instanceof Ext.tree.TreeNode) {            var r = data.node.getOwnerTree().recordFromNode(data.node);             if (r) {                 data.records = [ r ];             }         }		if (data.sourceType == 'grid') {			var items = data.items || [];			var ids	  = [];			if (this.getSelectedRecords().length)			{				var fromParent = this.getSelectedRecords()[0].data.id.split('_')[1];				var fromTitle = this.getSelectedRecords()[0].data.title;				root = (this.getSelectedRecords()[0].data.id.split('_')[0] == 'CPF' ? 'personal' : 'group')			}			else			{				var fromParent = this.getStore().getAt(0).id.split('_')[1];				var fromTitle = this.getStore().getAt(0).data.title;				root = (this.getStore().getAt(0).id.split('_')[0] == 'CPF' ? 'personal' : 'group')			}			for (var i = 0; i < items.length; ++i) {				ids.push(items[i].info.id);			}						var record	= this.store.getAt( this.indexOf(n) );			var params	= {				ids			: ids				,record		: record				,fromParent : fromParent				,root		: root			}			if (fromParent == -2)			{				Ext.Msg.alert('Error', 'You can not move contacts from Membership Directory.');				return;			}			console.log(ids, record);						if (record.data.title == "All Contacts")			{				Ext.Msg.alert('Error', 'You can not put a contact in All Contacts category.');				return;			}			else if (record.data.title == "Uncategorized")			{				Ext.Msg.confirm('Confitmation', 'Are you sure you want to remove this contact from all associated categories?',						function(btn) {							if (btn == 'yes') {								params.reload = true;								Eve.Resource.superbridge.broadcast(this, 'contact_move_item', params);							}					}, this);						} else			{				params.successMessage = true;			}				if (fromTitle == "Uncategorized")				params.reload = true;						if (record.data.title != "Uncategorized")				Eve.Resource.superbridge.broadcast(this, 'contact_move_item', params);					}         		if (data.records) {			for (var i = 0; i < data.records.length; i++) {				var r = data.records[i];				var dup = this.store.getById(r.id);				if (dup && (dd != this.dragZone)) {					if(!this.allowDup && !this.allowTrash){						Ext.fly(this.getNode(this.store.indexOf(dup))).frame("red", 1);						return true					}					var x=new Ext.data.Record();					r.id=x.id;					delete x;				}				if (data.copy) {					this.store.insert(insertAt++, r.copy());				} else {					if (data.sourceView) {						data.sourceView.isDirtyFlag = true;						data.sourceView.store.remove(r);					}					if(!this.allowTrash)this.store.insert(insertAt++, r);				}				if(this.sortField){					this.store.sort(this.sortField, this.sortDir);				}				this.isDirtyFlag = true;			}		}		if (this.dragZone) {			this.dragZone.cachedTarget = null;		}		        return true;     }, //    Ensure the multi proxy is removed     onEndDrag: function(data, e) {         var d = Ext.get(this.dragData.ddel);         if (d && d.hasClass("multi-proxy")) {             d.remove();             //delete this.dragData.ddel;         }     },     removeDropIndicators : function(n){         if(n){             Ext.fly(n).removeClass([                 "x-view-drag-insert-above", 				"x-view-drag-insert-left",				"x-view-drag-insert-right",                "x-view-drag-insert-below"]);             this.lastInsertClass = "_noclass";         }     }, /**  *    Utility method. Add a delete option to the DDView's context menu.  *    @param {String} imageUrl The URL of the "delete" icon image.  */     setDeletable: function(imageUrl) {         if (!this.singleSelect && !this.multiSelect) {             this.singleSelect = true;         }         var c = this.getContextMenu();         this.contextMenu.on("itemclick", function(item) {             switch (item.id) {                 case "delete":                     this.remove(this.getSelectedIndexes());                     break;             }         }, this);         this.contextMenu.add({             icon: imageUrl || AU.resolveUrl("/images/delete.gif"),             id: "delete",             text: AU.getMessage("deleteItem")         });     },      /**    Return the context menu for this DDView. */     getContextMenu: function() {         if (!this.contextMenu) { //            Create the View's context menu             this.contextMenu = new Ext.menu.Menu({                 id: this.id + "-contextmenu"             });             this.el.on("contextmenu", this.showContextMenu, this);         }         return this.contextMenu;     },          disableContextMenu: function() {         if (this.contextMenu) {             this.el.un("contextmenu", this.showContextMenu, this);         }     },     showContextMenu: function(e, item) {         item = this.findItemFromChild(e.getTarget());         if (item) {             e.stopEvent();             this.select(this.getNode(item), this.multiSelect && e.ctrlKey, true);             this.contextMenu.showAt(e.getXY());         }     }, /**  *    Remove {@link Ext.data.Record}s at the specified indices.  *    @param {Array/Number} selectedIndices The index (or Array of indices) of Records to remove.  */     remove: function(selectedIndices) {         selectedIndices = [].concat(selectedIndices);         for (var i = 0; i < selectedIndices.length; i++) {             var rec = this.store.getAt(selectedIndices[i]);             this.store.remove(rec);         }     }, /**  *    Double click fires the event, but also, if this is draggable, and there is only one other  *    related DropZone that is in another DDView, it drops the selected node on that DDView.  */     onDblClick : function(e){         var item = this.findItemFromChild(e.getTarget());         if(item){             if (this.fireEvent("dblclick", this, this.indexOf(item), item, e) === false) {                 return false;             }             if (this.dragGroup) {                 var targets = Ext.dd.DragDropMgr.getRelated(this.dragZone, true); //                Remove instances of this View's DropZone                 while (targets.contains(this.dropZone)) {                     targets.remove(this.dropZone);                 } //                If there's only one other DropZone, and it is owned by a DDView, then drop it in                 if ((targets.length == 1) && (targets[0].owningView)) {                     this.dragZone.cachedTarget = null;                     var el = Ext.get(targets[0].getEl());                     var box = el.getBox(true);                     targets[0].onNodeDrop(el.dom, {                         target: el.dom,                         xy: [box.x, box.y + box.height - 1]                     }, null, this.getDragData(e));                 }             }         }     },          onItemClick : function(item, index, e){ //        The DragZone's mousedown->getDragData already handled selection         if (this.ignoreNextClick) {             delete this.ignoreNextClick;             return;         }         if(this.fireEvent("beforeclick", this, index, item, e) === false){             return false;         }         if(this.multiSelect || this.singleSelect){             if(this.multiSelect && e.shiftKey && this.lastSelection){                this.select(this.getNodes(this.indexOf(this.lastSelection), index), false);             } else if (this.isSelected(item) && e.ctrlKey) {                 this.deselect(item);             }else{                 this.deselect(item);                 this.select(item, this.multiSelect && e.ctrlKey);                 this.lastSelection = item;             }             e.preventDefault();         }         return true;     } });  /*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/Multiselect.js *//*--------------------------------------------------*//*	Some changes made by Khashayar 		<khashayar@hyperoffice.com>	Some other changes made by Syavash	<syavash@hyperoffice.com>*///version 3.0Ext.ux.Multiselect = Ext.extend(Ext.form.Field,  {	store			: null,	dataFields		: [],	data			: [],	width			: 100,	height			: 100,	displayField	: 0,	valueField		: 1,	allowBlank		: true,	minLength		: 0,	maxLength		: Number.MAX_VALUE,	blankText		: Ext.form.TextField.prototype.blankText,	minLengthText	: 'Minimum {0} item(s) required',	maxLengthText	: 'Maximum {0} item(s) allowed',	copy			: false,	allowDup		: false,	allowTrash		: false,	legend			: null,	focusClass		: undefined,	delimiter		: ',',	view			: null,	dragGroup		: null,	dropGroup		: null,	tbar			: null,	appendOnly		: false,	sortField		: null,	sortDir			: 'ASC',	tpl				: null,	defaultAutoCreate : {tag: "div"},	    initComponent: function()	{		Ext.ux.Multiselect.superclass.initComponent.call(this);		this.addEvents({			'dblclick'		: true,			'click'			: true,			'change'		: true,			'drop'			: true,			'contextmenu'	: true		});			},	    onRender: function(ct, position)	{		var fs, cls, tpl;		Ext.ux.Multiselect.superclass.onRender.call(this, ct, position);				cls = 'ux-mselect';				var style = "padding: 1px;";		style += ( this.noBorder ) ? 'border:0px none;' : '';		fs = new Ext.form.FieldSet({			renderTo:this.el,			title:this.legend,			height:this.height,			width:this.width,			style:style,			tbar:this.tbar		});			// Commented by Khashayar		//if(!this.legend) fs.el.down('.'+fs.headerCls).remove();		fs.body.addClass(cls);		if(this.hideBodyScroll)			fs.body.setStyle("overflow", "hidden")				if (!this.tpl)		{			this.tpl = '<tpl for="."><div class="' + cls + '-item';			if(Ext.isIE || Ext.isIE7) this.tpl+='" unselectable=on';			else this.tpl+=' x-unselectable"';			this.tpl+= '>{[values.' + this.displayField + '.replace("<", "&lt;")]}</div></tpl>';		}				tpl = this.tpl;				if(!this.store)		{			this.store = new Ext.data.SimpleStore({				fields: this.dataFields,				data : this.data			});		}		this.view = new Ext.ux.DDView({			multiSelect		: true			,store			: this.store			,selectedClass	: cls + "-selected"			,tpl			: tpl			,allowDup		: this.allowDup			,copy			: this.copy			,allowTrash		: this.allowTrash			,dragGroup		: this.dragGroup			,dropGroup		: this.dropGroup			,itemSelector	: "." + cls + "-item"			,isFormField	: false			,applyTo		: fs.body			,appendOnly		: this.appendOnly			,sortField		: this.sortField			,sortDir		: this.sortDir		});				fs.add(this.view);				this.view.on('click', this.onViewClick, this);		this.view.on('beforeClick', this.onViewBeforeClick, this);		this.view.on('dblclick', this.onViewDblClick, this);		this.view.on('drop', function(ddView, n, dd, e, data){	    	return this.fireEvent("drop", ddView, n, dd, e, data);		}, this);		this.view.on('contextmenu', this.onViewCtxMenu, this);				this.hiddenName = this.name;		var hiddenTag={tag: "input", type: "hidden", value: "", name:this.name};		if (this.isFormField) { 			this.hiddenField = this.el.createChild(hiddenTag);		} else {			this.hiddenField = Ext.get(document.body).createChild(hiddenTag);		}		fs.doLayout();		// Important		this.view.getEl().dom.tabIndex = 0;		var parent = this.view.getEl().parent();		parent.setStyle('overflow-x', 'hidden');		if (this.keyMapField) {			var keymap = new Ext.KeyMap(this.view.getEl(), {				key		: 'abcdefghijklmnopqrstuvwxyz'				,handler: function(keyCode, e) {					var idx = this.view.store.findBy(function(record, id) {						var val = record.get( this.keyMapField );						val = val.substr(0, 1).toLowerCase();						if (val == String.fromCharCode(keyCode).toLowerCase()) {							return true;						}					}, this)					if (idx != '-1') {						this.view.select(idx);						this.view.getNode(idx).scrollIntoView();						this.onViewClick(this.view, idx, {}, e);					}				}				,scope	: this			})		}		var keyNav = new Ext.KeyNav(this.view.getEl(), {			"up" : function(e) {				var idx = this.view.getSelectedIndexes()[0];				if (idx > 0) {					this.view.select(idx - 1);					this.view.getNode(idx - 1).scrollIntoView();					this.onViewClick(this.view, idx, {}, e);				}			}			,"down" : function(e) {				var idx = this.view.getSelectedIndexes()[0];				if (idx < this.view.store.getCount() - 1) {					this.view.select(idx + 1);					this.view.getNode(idx + 1).scrollIntoView();					this.onViewClick(this.view, idx, {}, e);				}			}			,scope : this		});	},		initValue:Ext.emptyFn,		onViewClick: function(vw, index, node, e) {		var arrayIndex = this.preClickSelections.indexOf(index);				// And clause added by Khashayar		if (arrayIndex  != -1 && (this.getValue() != this.hiddenField.dom.value))		{			this.preClickSelections.splice(arrayIndex, 1);			this.view.clearSelections(true);			this.view.select(this.preClickSelections);		}		this.fireEvent('change', this, this.getValue(), this.hiddenField.dom.value);		this.hiddenField.dom.value = this.getValue();		this.fireEvent('click', this, e);		this.validate();			},	onViewBeforeClick: function(vw, index, node, e) {		this.preClickSelections = this.view.getSelectedIndexes();		if (this.disabled) {return false;}	},	onViewDblClick : function(vw, index, node, e) {		return this.fireEvent('dblclick', vw, index, node, e);	},		onViewCtxMenu : function(vw, index, node, e) {		return this.fireEvent('contextmenu', vw, index, node, e);	},		getValue: function(valueField){		var returnArray = [];		var selectionsArray = this.view.getSelectedIndexes();		if (selectionsArray.length == 0) {return '';}				for (var i=0; i<selectionsArray.length; i++) {			var vf	= (valueField != null)? valueField : this.valueField;			var rec = this.store.getAt(selectionsArray[i]);			returnArray.push(rec.get(vf));		}		return returnArray.join(this.delimiter);	},	setValue: function(values) {		var index;		var selections = [];		this.view.clearSelections();		this.hiddenField.dom.value = '';				if (!values || (values == '')) { return; }				if (!(values instanceof Array)) { values = values.split(this.delimiter); }		for (var i=0; i<values.length; i++) {			index = this.view.store.indexOf(this.view.store.query(this.valueField, 				new RegExp('^' + values[i] + '$', "i")).itemAt(0));			selections.push(index);		}		this.view.select(selections);		this.hiddenField.dom.value = this.getValue();		this.validate();	},		reset : function() {		this.setValue('');	},		getRawValue: function(valueField) {        var tmp = this.getValue(valueField);        if (tmp.length) {            tmp = tmp.split(this.delimiter);        }        else{            tmp = [];        }        return tmp;    },    setRawValue: function(values){        setValue(values);    },    validateValue : function(value){        if (value.length < 1) { // if it has no value             if (this.allowBlank) {                 this.clearInvalid();                 return true;             } else {                 this.markInvalid(this.blankText);                 return false;             }        }        if (value.length < this.minLength) {            this.markInvalid(String.format(this.minLengthText, this.minLength));            return false;        }        if (value.length > this.maxLength) {            this.markInvalid(String.format(this.maxLengthText, this.maxLength));            return false;        }        return true;    }});Ext.reg("multiselect", Ext.ux.Multiselect);Ext.ux.ItemSelector = Ext.extend(Ext.form.Field,  {	msWidth			: 200,	msHeight		: 300,	hideNavIcons	: false,	imagePath		: Eve.imagePath + "components/ItemSelector",	iconUp			: "up2.gif",	iconDown		: "down2.gif",	iconLeft		: "left2.gif",	iconRight		: "right2.gif",	iconTop			: "top2.gif",	iconBottom		: "bottom2.gif",	iconAllRight	: "allRight2.gif",	iconAllLeft		: "allLeft2.gif",	drawUpIcon		: true,	drawDownIcon	: true,	drawLeftIcon	: true,	drawRightIcon	: true,	drawTopIcon		: true,	drawBotIcon		: true,	drawAllRightIcon: true,	drawAllLeftIcon : true,	fromStore		: null,	toStore			: null,	fromData		: null, 	toData			: null,	displayField	: 0,	valueField		: 1,	switchToFrom	: false,	allowDup		: false,	focusClass		: undefined,	delimiter		: ',',	readOnly		: false,	toLegend		: null,	fromLegend		: null,	toSortField		: null,	fromSortField	: null,	toSortDir		: 'ASC',	fromSortDir		: 'ASC',	toTBar			: null,	fromTBar		: null,	bodyStyle		: null,	border			: false,	fromTpl			: null,	toTpl			: null,	defaultAutoCreate:{tag: "div"},	    initComponent: function(){		Ext.ux.ItemSelector.superclass.initComponent.call(this);		this.addEvents({			'rowdblclick' : true,			'change' : true		});				},    onRender: function(ct, position){		Ext.ux.ItemSelector.superclass.onRender.call(this, ct, position);		this.fromMultiselect = new Ext.ux.Multiselect({			legend		: this.fromLegend,			delimiter	: this.delimiter,			allowDup	: this.allowDup,			copy		: this.allowDup,			allowTrash	: this.allowDup,			dragGroup	: this.readOnly ? null : "drop2-"+this.el.dom.id,			dropGroup	: this.readOnly ? null : "drop1-"+this.el.dom.id,			width		: this.msWidth,			height		: this.msHeight,			dataFields	: this.dataFields,			data		: this.fromData,			displayField: this.displayField,			valueField	: this.valueField,			store		: this.fromStore,			isFormField	: false,			tbar		: this.fromTBar,			appendOnly	: true,			sortField	: this.fromSortField,			sortDir		: this.fromSortDir,			tpl			: this.fromTpl		});		this.fromMultiselect.on('dblclick', this.onRowDblClick, this);		if (!this.toStore) {			this.toStore = new Ext.data.SimpleStore({				fields: this.dataFields,				data : this.toData			});		}		this.toStore.on('add', this.valueChanged, this);		this.toStore.on('remove', this.valueChanged, this);		this.toStore.on('load', this.valueChanged, this);		this.toMultiselect = new Ext.ux.Multiselect({			legend		: this.toLegend,			delimiter	: this.delimiter,			allowDup	: this.allowDup,			dragGroup	: this.readOnly ? null : "drop1-"+this.el.dom.id,			//dropGroup	: this.readOnly ? null : "drop2-"+this.el.dom.id+(this.toSortField ? "" : ",drop1-"+this.el.dom.id),			dropGroup	: this.readOnly ? null : "drop2-"+this.el.dom.id+",drop1-"+this.el.dom.id,			width		: this.msWidth,			height		: this.msHeight,			displayField: this.displayField,			valueField	: this.valueField,			store		: this.toStore,			isFormField	: false,			tbar		: this.toTBar,			sortField	: this.toSortField,			sortDir		: this.toSortDir,			tpl			: this.toTpl		});		this.toMultiselect.on('dblclick', this.onRowDblClick, this);						var p = new Ext.Panel({			bodyStyle:this.bodyStyle,			border:this.border,			layout:"table",			height: this.height,			layoutConfig:{columns:3}		});		p.add(this.switchToFrom ? this.toMultiselect : this.fromMultiselect);		var icons = new Ext.Panel({header:false});		p.add(icons);		p.add(this.switchToFrom ? this.fromMultiselect : this.toMultiselect);		p.render(this.el);		icons.el.down('.'+icons.bwrapCls).remove();		if (this.imagePath!="" && this.imagePath.charAt(this.imagePath.length-1)!="/")			this.imagePath+="/";		this.iconUp		= this.imagePath + (this.iconUp || 'up2.gif');		this.iconDown	= this.imagePath + (this.iconDown || 'down2.gif');		this.iconLeft	= this.imagePath + (this.iconLeft || 'left2.gif');		this.iconRight	= this.imagePath + (this.iconRight || 'right2.gif');		this.iconTop	= this.imagePath + (this.iconTop || 'top2.gif');		this.iconBottom = this.imagePath + (this.iconBottom || 'bottom2.gif');		this.iconAllRight = this.imagePath + (this.iconAllRight || 'allRight2.gif');		this.iconAllLeft = this.imagePath + (this.iconAllLeft || 'allLeft2.gif');		var el=icons.getEl();		if (!this.toSortField) {			this.toTopIcon = el.createChild({tag:'img', src:this.iconTop, style:{cursor:'pointer', margin:'2px'}});			el.createChild({tag: 'br'});			this.upIcon = el.createChild({tag:'img', src:this.iconUp, style:{cursor:'pointer', margin:'2px'}});			el.createChild({tag: 'br'});		}		//Ghazale added		this.addAllIcon = el.createChild({tag:'img', src:this.switchToFrom?this.iconAllLeft:this.iconAllRight, style:{cursor:'pointer', margin:'2px'}});		el.createChild({tag: 'br'});				this.addIcon = el.createChild({tag:'img', src:this.switchToFrom?this.iconLeft:this.iconRight, style:{cursor:'pointer', margin:'2px'}});		el.createChild({tag: 'br'});		this.removeIcon = el.createChild({tag:'img', src:this.switchToFrom?this.iconRight:this.iconLeft, style:{cursor:'pointer', margin:'2px'}});		el.createChild({tag: 'br'});		//Ghazale added		this.removeAllIcon = el.createChild({tag:'img', src:this.switchToFrom?this.iconAllRight:this.iconAllLeft, style:{cursor:'pointer', margin:'2px'}});		el.createChild({tag: 'br'});		if (!this.toSortField) {			this.downIcon = el.createChild({tag:'img', src:this.iconDown, style:{cursor:'pointer', margin:'2px'}});			el.createChild({tag: 'br'});			this.toBottomIcon = el.createChild({tag:'img', src:this.iconBottom, style:{cursor:'pointer', margin:'2px'}});		}		if (!this.readOnly) {			if (!this.toSortField) {				this.toTopIcon.on('click', this.toTop, this);				this.upIcon.on('click', this.up, this);				this.downIcon.on('click', this.down, this);				this.toBottomIcon.on('click', this.toBottom, this);			}			this.addIcon.on('click', this.fromTo, this);			this.addAllIcon.on('click', this.allFromTo, this);			this.removeIcon.on('click', this.toFrom, this);			this.removeAllIcon.on('click', this.allToFrom, this);		}		if (!this.drawUpIcon || this.hideNavIcons) { this.upIcon.dom.style.display='none'; }		if (!this.drawDownIcon || this.hideNavIcons) { this.downIcon.dom.style.display='none'; }		if (!this.drawLeftIcon || this.hideNavIcons) { this.addIcon.dom.style.display='none'; }		if (!this.drawAllLeftIcon || this.hideNavIcons) { this.addAllIcon.dom.style.display='none'; }		if (!this.drawRightIcon || this.hideNavIcons) { this.removeIcon.dom.style.display='none'; }		if (!this.drawAllRightIcon || this.hideNavIcons) { this.removeAllIcon.dom.style.display='none'; }		if (!this.drawTopIcon || this.hideNavIcons) { this.toTopIcon.dom.style.display='none'; }		if (!this.drawBotIcon || this.hideNavIcons) { this.toBottomIcon.dom.style.display='none'; }		var tb = p.body.first();		this.el.setWidth(p.body.first().getWidth());		p.body.removeClass();				this.hiddenName = this.name;		var hiddenTag={tag: "input", type: "hidden", value: "", name:this.name};		this.hiddenField = this.el.createChild(hiddenTag);		this.valueChanged(this.toStore);	},		initValue:Ext.emptyFn,		toTop : function() {		var selectionsArray = this.toMultiselect.view.getSelectedIndexes();		var records = [];		if (selectionsArray.length > 0) {			selectionsArray.sort();			for (var i=0; i<selectionsArray.length; i++) {				record = this.toMultiselect.view.store.getAt(selectionsArray[i]);				records.push(record);			}			selectionsArray = [];			for (var i=records.length-1; i>-1; i--) {				record = records[i];				this.toMultiselect.view.store.remove(record);				this.toMultiselect.view.store.insert(0, record);				selectionsArray.push(((records.length - 1) - i));			}		}		this.toMultiselect.view.refresh();		this.toMultiselect.view.select(selectionsArray);	},	toBottom : function() {		var selectionsArray = this.toMultiselect.view.getSelectedIndexes();		var records = [];		if (selectionsArray.length > 0) {			selectionsArray.sort();			for (var i=0; i<selectionsArray.length; i++) {				record = this.toMultiselect.view.store.getAt(selectionsArray[i]);				records.push(record);			}			selectionsArray = [];			for (var i=0; i<records.length; i++) {				record = records[i];				this.toMultiselect.view.store.remove(record);				this.toMultiselect.view.store.add(record);				selectionsArray.push((this.toMultiselect.view.store.getCount()) - (records.length - i));			}		}		this.toMultiselect.view.refresh();		this.toMultiselect.view.select(selectionsArray);	},		up : function() {		var record = null;		var selectionsArray = this.toMultiselect.view.getSelectedIndexes();		selectionsArray.sort();		var newSelectionsArray = [];		if (selectionsArray.length > 0) {			for (var i=0; i<selectionsArray.length; i++) {				record = this.toMultiselect.view.store.getAt(selectionsArray[i]);				if ((selectionsArray[i] - 1) >= 0) {					this.toMultiselect.view.store.remove(record);					this.toMultiselect.view.store.insert(selectionsArray[i] - 1, record);					newSelectionsArray.push(selectionsArray[i] - 1);				}			}			this.toMultiselect.view.refresh();			this.toMultiselect.view.select(newSelectionsArray);		}	},	down : function() {		var record = null;		var selectionsArray = this.toMultiselect.view.getSelectedIndexes();		selectionsArray.sort();		selectionsArray.reverse();		var newSelectionsArray = [];		if (selectionsArray.length > 0) {			for (var i=0; i<selectionsArray.length; i++) {				record = this.toMultiselect.view.store.getAt(selectionsArray[i]);				if ((selectionsArray[i] + 1) < this.toMultiselect.view.store.getCount()) {					this.toMultiselect.view.store.remove(record);					this.toMultiselect.view.store.insert(selectionsArray[i] + 1, record);					newSelectionsArray.push(selectionsArray[i] + 1);				}			}			this.toMultiselect.view.refresh();			this.toMultiselect.view.select(newSelectionsArray);		}	},		fromTo : function() {		var selectionsArray = this.fromMultiselect.view.getSelectedIndexes();		var records = [];		if (selectionsArray.length > 0) {			for (var i=0; i<selectionsArray.length; i++) {				record = this.fromMultiselect.view.store.getAt(selectionsArray[i]);				records.push(record);			}			if(!this.allowDup)selectionsArray = [];			for (var i=0; i<records.length; i++) {				record = records[i];				if(this.allowDup){					var x=new Ext.data.Record();					record.id=x.id;					delete x;						this.toMultiselect.view.store.add(record);				}else{					this.fromMultiselect.view.store.remove(record);					this.toMultiselect.view.store.add(record);					selectionsArray.push((this.toMultiselect.view.store.getCount() - 1));				}			}		}		this.toMultiselect.view.refresh();		this.fromMultiselect.view.refresh();		if(this.toSortField)this.toMultiselect.store.sort(this.toSortField, this.toSortDir);		if(this.allowDup)this.fromMultiselect.view.select(selectionsArray);		else this.toMultiselect.view.select(selectionsArray);	},	allFromTo : function(){		var fromSt = this.fromMultiselect.view.store;		var toSt = this.toMultiselect.view.store;		toSt.add(fromSt.data.items);		fromSt.removeAll();	},	allToFrom : function(){		var fromSt = this.fromMultiselect.view.store;		var toSt = this.toMultiselect.view.store;		fromSt.add(toSt.data.items);		toSt.removeAll();	},		toFrom : function() {		var selectionsArray = this.toMultiselect.view.getSelectedIndexes();		var records = [];		if (selectionsArray.length > 0) {			for (var i=0; i<selectionsArray.length; i++) {				record = this.toMultiselect.view.store.getAt(selectionsArray[i]);				records.push(record);			}			selectionsArray = [];			for (var i=0; i<records.length; i++) {				record = records[i];				this.toMultiselect.view.store.remove(record);				if(!this.allowDup){					this.fromMultiselect.view.store.add(record);					selectionsArray.push((this.fromMultiselect.view.store.getCount() - 1));				}			}		}		this.fromMultiselect.view.refresh();		this.toMultiselect.view.refresh();		if(this.fromSortField)this.fromMultiselect.store.sort(this.fromSortField, this.fromSortDir);		this.fromMultiselect.view.select(selectionsArray);	},		valueChanged: function(store) {		var record = null;		var values = [];		for (var i=0; i<store.getCount(); i++) {			record = store.getAt(i);			values.push(record.get(this.valueField));		}		this.hiddenField.dom.value = values.join(this.delimiter);		this.fireEvent('change', this, this.getValue(), this.hiddenField.dom.value);	},		getValue : function() {		return this.hiddenField.dom.value;	},		onRowDblClick : function(vw, index, node, e) {		return this.fireEvent('rowdblclick', vw, index, node, e);	},		reset: function(){		range = this.toMultiselect.store.getRange();		this.toMultiselect.store.removeAll();		if (!this.allowDup) {			this.fromMultiselect.store.add(range);			this.fromMultiselect.store.sort(this.displayField,'ASC');		}		this.valueChanged(this.toMultiselect.store);	}});Ext.reg("itemselector", Ext.ux.ItemSelector);/*** Author Hamidreza*/Ext.ux.ThreeColumnItemSelector = Ext.extend(Ext.form.Field,  {    msWidth:200,    msHeight:300,    hideNavIcons:false,    imagePath : Eve.imagePath + "components/ItemSelector",    iconUp:"up2.gif",    iconDown:"down2.gif",    iconLeft:"left2.gif",    iconRight:"right2.gif",    iconTop:"top2.gif",    iconBottom:"bottom2.gif",    drawUpIcon:false,    drawDownIcon:false,    drawLeftIcon:true,    drawRightIcon:true,    drawTopIcon:false,    drawBotIcon:false,    fromStore:null,    toStore:null,    nextToStore:null,    fromData:null,    toData:null,    toNextData:null,    displayField:0,    valueField:1,    switchToFrom:false,    allowDup:false,    focusClass:undefined,    delimiter:',',    readOnly:false,    toLegend:null,    fromLegend:null,    nextToLegend:null,    toSortField:null,    nextToSortField:null,    fromSortField:null,    toSortDir:'ASC',    nextToSortDir:'ASC',    fromSortDir:'ASC',    toTBar:null,    toNextTar:null,    fromTBar:null,    bodyStyle:null,    border:false,    defaultAutoCreate:{tag: "div"},    initComponent: function(){        Ext.ux.ThreeColumnItemSelector.superclass.initComponent.call(this);        this.addEvents({            'rowdblclick' : true,            'change' : true        });    },    onRender: function(ct, position) {        Ext.ux.ThreeColumnItemSelector.superclass.onRender.call(this, ct, position);        this.hiddenName1 = this.fromName;        this.hiddenName2 = this.toName;        this.hiddenName3 = this.nextToName;        var hiddenTag1 = {tag: "input", type: "hidden", value: "", name: this.fromName};        var hiddenTag2 = {tag: "input", type: "hidden", value: "", name: this.toName};        var hiddenTag3 = {tag: "input", type: "hidden", value: "", name: this.nextToName};        this.hiddenField1 = this.el.createChild(hiddenTag1);        this.hiddenField2 = this.el.createChild(hiddenTag2);        this.hiddenField3 = this.el.createChild(hiddenTag3);		// Template		var tpl =  '<tpl for="."><div class="ux-mselect-item';		if(Ext.isIE || Ext.isIE7) tpl+='" unselectable=on';		else tpl+=' x-unselectable"';		tpl+= '>{[values.' + this.displayField + '.replace("<", "&lt;")]} ';		tpl+= '<tpl if="hidden &gt; 0">(Hidden)</tpl>';		tpl+='</div></tpl>';        this.fromMultiselect = new Ext.ux.Multiselect({            legend: this.fromLegend,            delimiter: this.delimiter,            allowDup: this.allowDup,            copy: this.allowDup,            allowTrash: this.allowDup,            dragGroup: this.readOnly ? null : "drop2-"+this.el.dom.id,            dropGroup: this.readOnly ? null : "drop1-"+this.el.dom.id,            width: this.msWidth,            height: this.msHeight,            dataFields: this.dataFields,            data: this.fromData,            displayField: this.displayField,            valueField: this.valueField,            store: this.fromStore,            isFormField: false,            tbar: this.fromTBar,            appendOnly: true,            sortField: this.fromSortField,            sortDir: this.fromSortDir,			tpl: tpl        });        this.fromMultiselect.on('dblclick', this.onRowDblClick, this);        if (!this.fromStore) {            this.fromStore = new Ext.data.SimpleStore({                fields: this.dataFields,                data : this.fromData            });        }                        this.fromStore.on('add', function(store){        	this.valueChanged(store, this.hiddenField1);    	}, this);        this.fromStore.on('remove', function(store){        	this.valueChanged(store, this.hiddenField1);    	}, this);        this.fromStore.on('load', function(store){        	this.valueChanged(store, this.hiddenField1);    	}, this);                        if (!this.toStore) {            this.toStore = new Ext.data.SimpleStore({                fields: this.dataFields,                data : this.toData            });        }                this.toStore.on('add', function(store){        	this.valueChanged(store, this.hiddenField2);    	}, this);        this.toStore.on('remove', function(store){        	this.valueChanged(store, this.hiddenField2);    	}, this);        this.toStore.on('load', function(store){        	this.valueChanged(store, this.hiddenField2);    	}, this);                this.toMultiselect = new Ext.ux.Multiselect({            legend: this.toLegend,            delimiter: this.delimiter,            allowDup: this.allowDup,            dragGroup: this.readOnly ? null : "drop1-"+this.el.dom.id,            //dropGroup: this.readOnly ? null : "drop2-"+this.el.dom.id+(this.toSortField ? "" : ",drop1-"+this.el.dom.id),            dropGroup: this.readOnly ? null : "drop2-"+this.el.dom.id+",drop1-"+this.el.dom.id,            width: this.msWidth,            height: this.msHeight,            displayField: this.displayField,            valueField: this.valueField,            store: this.toStore,            isFormField: false,            tbar: this.toTBar,            sortField: this.toSortField,            sortDir: this.toSortDir,			tpl: tpl        });        this.toMultiselect.on('dblclick', this.onRowDblClick, this);        if (!this.nextToStore) {            this.nextToStore = new Ext.data.SimpleStore({                fields: this.dataFields,                data : this.toNextData            });        }        this.nextToStore.on('add', function(store){        	this.valueChanged(store, this.hiddenField3);    	}, this);        this.nextToStore.on('remove', function(store){        	this.valueChanged(store, this.hiddenField3);    	}, this);		        this.nextToStore.on('load', function(store){        	this.valueChanged(store, this.hiddenField3);    	}, this);        this.nextToMultiselect = new Ext.ux.Multiselect({            legend: this.nextToLegend,            delimiter: this.delimiter,            allowDup: this.allowDup,            dragGroup: this.readOnly ? null : "drop1-"+this.el.dom.id,            //dropGroup: this.readOnly ? null : "drop2-"+this.el.dom.id+(this.toSortField ? "" : ",drop1-"+this.el.dom.id),            dropGroup: this.readOnly ? null : "drop2-"+this.el.dom.id+",drop1-"+this.el.dom.id,            width: this.msWidth,            height: this.msHeight,            displayField: this.displayField,            valueField: this.valueField,            store: this.nextToStore,            isFormField: false,            tbar: this.toNextTar,            sortField: this.nextToSortField,            sortDir: this.nextToSortDir,			tpl: tpl        });        this.nextToMultiselect.on('dblclick', this.onRowDblClick, this);        var p = new Ext.Panel({            bodyStyle:this.bodyStyle,            border:this.border,            layout:"table",            layoutConfig:{columns:5}        });        p.add(this.switchToFrom ? this.toMultiselect : this.fromMultiselect);        var icons1 = new Ext.Panel({header:false});        var icons2 = new Ext.Panel({header:false});        p.add(icons1);        p.add(this.switchToFrom ? this.fromMultiselect : this.toMultiselect);        p.add(icons2);        p.add(this.nextToMultiselect);        p.render(this.el);        icons1.el.down('.'+icons1.bwrapCls).remove();        icons2.el.down('.'+icons2.bwrapCls).remove();        if (this.imagePath!="" && this.imagePath.charAt(this.imagePath.length-1)!="/") {            this.imagePath+="/";		}        this.iconUp = this.imagePath + (this.iconUp || 'up2.gif');        this.iconDown = this.imagePath + (this.iconDown || 'down2.gif');        this.iconLeft = this.imagePath + (this.iconLeft || 'left2.gif');        this.iconRight = this.imagePath + (this.iconRight || 'right2.gif');        this.iconTop = this.imagePath + (this.iconTop || 'top2.gif');        this.iconBottom = this.imagePath + (this.iconBottom || 'bottom2.gif');        var el1=icons1.getEl();        var el2=icons2.getEl();        if (!this.toSortField) {            this.toTopIcon1 = el1.createChild({tag:'img', src:this.iconTop, style:{cursor:'pointer', margin:'2px'}});            this.toTopIcon2 = el2.createChild({tag:'img', src:this.iconTop, style:{cursor:'pointer', margin:'2px'}});            el1.createChild({tag: 'br'});            el2.createChild({tag: 'br'});            this.upIcon1 = el1.createChild({tag:'img', src:this.iconUp, style:{cursor:'pointer', margin:'2px'}});            this.upIcon2 = el2.createChild({tag:'img', src:this.iconUp, style:{cursor:'pointer', margin:'2px'}});            el1.createChild({tag: 'br'});            el2.createChild({tag: 'br'});        }        this.addIcon1 = el1.createChild({tag:'img', src:this.switchToFrom?this.iconLeft:this.iconRight, style:{cursor:'pointer', margin:'2px'}});        this.addIcon2 = el2.createChild({tag:'img', src:this.switchToFrom?this.iconLeft:this.iconRight, style:{cursor:'pointer', margin:'2px'}});        el1.createChild({tag: 'br'});        el2.createChild({tag: 'br'});        this.removeIcon1 = el1.createChild({tag:'img', src:this.switchToFrom?this.iconRight:this.iconLeft, style:{cursor:'pointer', margin:'2px'}});        this.removeIcon2 = el2.createChild({tag:'img', src:this.switchToFrom?this.iconRight:this.iconLeft, style:{cursor:'pointer', margin:'2px'}});        el1.createChild({tag: 'br'});        el2.createChild({tag: 'br'});        if (!this.toSortField) {            this.downIcon1 = el1.createChild({tag:'img', src:this.iconDown, style:{cursor:'pointer', margin:'2px'}});            this.downIcon2 = el2.createChild({tag:'img', src:this.iconDown, style:{cursor:'pointer', margin:'2px'}});            el1.createChild({tag: 'br'});            el2.createChild({tag: 'br'});            this.toBottomIcon1 = el1.createChild({tag:'img', src:this.iconBottom, style:{cursor:'pointer', margin:'2px'}});            this.toBottomIcon2 = el2.createChild({tag:'img', src:this.iconBottom, style:{cursor:'pointer', margin:'2px'}});        }        if (!this.readOnly) {            if (!this.toSortField) {                this.toTopIcon1.on('click', this.toTop, this, this.toMultiselect);                this.upIcon1.on('click', this.up, this, this.toMultiselect);                this.downIcon1.on('click', this.down, this, this.toMultiselect);                this.toBottomIcon1.on('click', this.toBottom, this, this.toMultiselect);                this.toTopIcon2.on('click', this.toTop, this, this.nextToMultiselect);                this.upIcon2.on('click', this.up, this, this.nextToMultiselect);                this.downIcon2.on('click', this.down, this, this.nextToMultiselect);                this.toBottomIcon2.on('click', this.toBottom, this, this.nextToMultiselect);            }            this.addIcon1.on('click', this.fromTo, this);            this.removeIcon1.on('click', this.toFrom, this);            this.addIcon2.on('click', this.toNext, this);            this.removeIcon2.on('click', this.nextTo, this);        }        if (!this.drawUpIcon || this.hideNavIcons) { this.upIcon1.dom.style.display='none'; }        if (!this.drawDownIcon || this.hideNavIcons) { this.downIcon1.dom.style.display='none'; }        if (!this.drawLeftIcon || this.hideNavIcons) { this.addIcon1.dom.style.display='none'; }        if (!this.drawRightIcon || this.hideNavIcons) { this.removeIcon1.dom.style.display='none'; }        if (!this.drawTopIcon || this.hideNavIcons) { this.toTopIcon1.dom.style.display='none'; }        if (!this.drawBotIcon || this.hideNavIcons) { this.toBottomIcon1.dom.style.display='none'; }    	if (!this.drawUpIcon || this.hideNavIcons) { this.upIcon2.dom.style.display='none'; }        if (!this.drawDownIcon || this.hideNavIcons) { this.downIcon2.dom.style.display='none'; }        if (!this.drawLeftIcon || this.hideNavIcons) { this.addIcon2.dom.style.display='none'; }        if (!this.drawRightIcon || this.hideNavIcons) { this.removeIcon2.dom.style.display='none'; }        if (!this.drawTopIcon || this.hideNavIcons) { this.toTopIcon2.dom.style.display='none'; }        if (!this.drawBotIcon || this.hideNavIcons) { this.toBottomIcon2.dom.style.display='none'; }        var tb = p.body.first();        this.el.setWidth(p.body.first().getWidth());        p.body.removeClass();        this.valueChanged(this.fromStore, this.hiddenField1);        this.valueChanged(this.toStore, this.hiddenField2);        this.valueChanged(this.nextToStore, this.hiddenField3);    },    initValue:Ext.emptyFn,    toTop : function(event, icon, object) {        var selectionsArray = object.view.getSelectedIndexes();        var records = [];        if (selectionsArray.length > 0) {            selectionsArray.sort();            for (var i=0; i<selectionsArray.length; i++) {                record = object.view.store.getAt(selectionsArray[i]);                records.push(record);            }            selectionsArray = [];            for (var i=records.length-1; i>-1; i--) {                record = records[i];                object.view.store.remove(record);                object.view.store.insert(0, record);                selectionsArray.push(((records.length - 1) - i));            }        }        object.view.refresh();        object.view.select(selectionsArray);    },    toBottom : function(event, icon, object) {        var selectionsArray = object.view.getSelectedIndexes();        var records = [];        if (selectionsArray.length > 0) {            selectionsArray.sort();            for (var i=0; i<selectionsArray.length; i++) {                record = object.view.store.getAt(selectionsArray[i]);                records.push(record);            }            selectionsArray = [];            for (var i=0; i<records.length; i++) {                record = records[i];                object.view.store.remove(record);                object.view.store.add(record);                selectionsArray.push((object.view.store.getCount()) - (records.length - i));            }        }        object.view.refresh();        object.view.select(selectionsArray);    },    up : function(event, icon, object) {        var record = null;        var selectionsArray = object.view.getSelectedIndexes();        selectionsArray.sort();        var newSelectionsArray = [];        if (selectionsArray.length > 0) {            for (var i=0; i<selectionsArray.length; i++) {                record = object.view.store.getAt(selectionsArray[i]);                if ((selectionsArray[i] - 1) >= 0) {                    object.view.store.remove(record);                    object.view.store.insert(selectionsArray[i] - 1, record);                    newSelectionsArray.push(selectionsArray[i] - 1);                }            }            object.view.refresh();            object.view.select(newSelectionsArray);        }    },    down : function(event, icon, object) {        var record = null;        var selectionsArray = object.view.getSelectedIndexes();        selectionsArray.sort();        selectionsArray.reverse();        var newSelectionsArray = [];        if (selectionsArray.length > 0) {            for (var i=0; i<selectionsArray.length; i++) {                record = object.view.store.getAt(selectionsArray[i]);                if ((selectionsArray[i] + 1) < object.view.store.getCount()) {                    object.view.store.remove(record);                    object.view.store.insert(selectionsArray[i] + 1, record);                    newSelectionsArray.push(selectionsArray[i] + 1);                }            }            object.view.refresh();            object.view.select(newSelectionsArray);        }    },    fromTo : function() {        var selectionsArray = this.fromMultiselect.view.getSelectedIndexes();        var records = [];        if (selectionsArray.length > 0) {            for (var i=0; i<selectionsArray.length; i++) {                record = this.fromMultiselect.view.store.getAt(selectionsArray[i]);                records.push(record);            }            if(!this.allowDup)selectionsArray = [];            for (var i=0; i<records.length; i++) {                record = records[i];                if(this.allowDup){                    var x=new Ext.data.Record();                    record.id=x.id;                    delete x;                    this.toMultiselect.view.store.add(record);                }else{                    this.fromMultiselect.view.store.remove(record);                    this.toMultiselect.view.store.add(record);                    selectionsArray.push((this.toMultiselect.view.store.getCount() - 1));                }            }        }        this.toMultiselect.view.refresh();        this.fromMultiselect.view.refresh();        if(this.toSortField)this.toMultiselect.store.sort(this.toSortField, this.toSortDir);        if(this.allowDup)this.fromMultiselect.view.select(selectionsArray);        else this.toMultiselect.view.select(selectionsArray);    },    toNext : function() {        var selectionsArray = this.toMultiselect.view.getSelectedIndexes();        var records = [];        if (selectionsArray.length > 0) {            for (var i=0; i<selectionsArray.length; i++) {                record = this.toMultiselect.view.store.getAt(selectionsArray[i]);                records.push(record);            }            if(!this.allowDup)selectionsArray = [];            for (var i=0; i<records.length; i++) {                record = records[i];                if(this.allowDup){                    var x=new Ext.data.Record();                    record.id=x.id;                    delete x;                    this.toMultiselect.view.store.add(record);                }else{                    this.toMultiselect.view.store.remove(record);                    this.nextToMultiselect.view.store.add(record);                    selectionsArray.push((this.nextToMultiselect.view.store.getCount() - 1));                }            }        }        this.nextToMultiselect.view.refresh();        this.toMultiselect.view.refresh();        if(this.nextToSortField)this.nextToMultiselect.store.sort(this.nextToSortField, this.nextToSortDir);        if(this.allowDup)this.toMultiselect.view.select(selectionsArray);        else this.nextToMultiselect.view.select(selectionsArray);    },    toFrom : function() {        var selectionsArray = this.toMultiselect.view.getSelectedIndexes();        var records = [];        if (selectionsArray.length > 0) {            for (var i=0; i<selectionsArray.length; i++) {                record = this.toMultiselect.view.store.getAt(selectionsArray[i]);                records.push(record);            }            selectionsArray = [];            for (var i=0; i<records.length; i++) {                record = records[i];                this.toMultiselect.view.store.remove(record);                if(!this.allowDup){                    this.fromMultiselect.view.store.add(record);                    selectionsArray.push((this.fromMultiselect.view.store.getCount() - 1));                }            }        }        this.fromMultiselect.view.refresh();        this.toMultiselect.view.refresh();        if(this.fromSortField)this.fromMultiselect.store.sort(this.fromSortField, this.fromSortDir);        this.fromMultiselect.view.select(selectionsArray);    },	nextTo : function() {        var selectionsArray = this.nextToMultiselect.view.getSelectedIndexes();        var records = [];        if (selectionsArray.length > 0) {            for (var i=0; i<selectionsArray.length; i++) {                record = this.nextToMultiselect.view.store.getAt(selectionsArray[i]);                records.push(record);            }            selectionsArray = [];            for (var i=0; i<records.length; i++) {                record = records[i];                this.nextToMultiselect.view.store.remove(record);                if(!this.allowDup){                    this.toMultiselect.view.store.add(record);                    selectionsArray.push((this.toMultiselect.view.store.getCount() - 1));                }            }        }        this.nextToMultiselect.view.refresh();        this.toMultiselect.view.refresh();        if(this.nextToSortField)this.toMultiselect.store.sort(this.nextToSortField, this.nextToSortDir);        this.toMultiselect.view.select(selectionsArray);    },    valueChanged: function(store, hiddenField) {		if (! hiddenField.dom) {			return		}        var record = null;        var values = [];		        for (var i = 0; i < store.getCount(); i++) {            record = store.getAt(i);            values.push(record.get(this.valueField));        }		        hiddenField.dom.value = values.join(this.delimiter);        this.fireEvent('change', this, this.getValue(), hiddenField.dom.value);    },    getValue : function(name) {    	if(name == this.hiddenName1){    		return this.hiddenField1.dom.value;    	}else if(name == this.hiddenName2){    		return this.hiddenField2.dom.value;    	}else if(name == this.hiddenName3){    		return this.hiddenField3.dom.value;    	}    },    onRowDblClick : function(vw, index, node, e) {        return this.fireEvent('rowdblclick', vw, index, node, e);    },    reset: function(name){    	var object = {};    	if(name == this.hiddenName1){			object = this.fromMultiselect;		}else if(name == this.hiddenName2){			object = this.toMultiselect;		}else if(name == this.hiddenName3){			object = this.nextToMultiselect;		}        range = object.store.getRange();        object.store.removeAll();        if (!this.allowDup) {            this.fromMultiselect.store.add(range);            this.fromMultiselect.store.sort(this.displayField,'ASC');        }        this.valueChanged(object.store);    }});Ext.reg("threecolumnitemselector", Ext.ux.ThreeColumnItemSelector);/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/CheckColumn.js *//*--------------------------------------------------*/Ext.grid.CheckColumn = function(config){	this.addEvents({		click: true	});		Ext.grid.CheckColumn.superclass.constructor.call(this);		Ext.apply(this, config, {		init : function(grid)		{			this.grid = grid;			this.grid.on('render', function()			{				var view = this.grid.getView();				view.mainBody.on('click', this.onClick, this);			}, this);		},			onClick : function(e, t)		{			if(t.className!="" && t.className.indexOf('x-grid3-cc-'+this.id) != -1)			{				e.stopEvent();				var index = this.grid.getView().findRowIndex(t);				var record = this.grid.store.getAt(index);				var recVal = (record.data[this.dataIndex]);				var value, xvalue;								if(recVal == 0 || recVal == 'false' || recVal == false) {					value = false				}				else if(recVal == 1 || recVal == 'true' || recVal == true) {					value = true				}				xvalue = !(value);				record.set(this.dataIndex, xvalue);				this.fireEvent('click', this, e, record, xvalue);			}		},		renderer : function(v, p, record)		{			if (v == '1' || v == 'true' || v == true) {				v = '1';			}			else if (v == '0' || v == 'false' || v == false) {				v = '0';			}						//the +v type converts to a number (json returns a string			//which always evaluates true)			var checkState = (+v) ? '-on' : '';						p.css += ' x-grid3-check-col-td'; 		  			return '<div class="grid-checkbox'+ checkState +' x-grid3-cc-'+this.id+'"> </div>';		}	});	  if(!this.id)  {	  this.id = Ext.id();  }  this.renderer = this.renderer.createDelegate(this);};// extend Ext.util.ObservableExt.extend(Ext.grid.CheckColumn, Ext.util.Observable);/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/xDataView.js *//*--------------------------------------------------*/Eve.DataView = Ext.extend(Ext.DataView, {	// private	onItemClick : function(item, index, e){        if(this.fireEvent("beforeclick", this, index, item, e) === false){            return false;        }        if(this.multiSelect){            this.doMultiSelection(item, index, e);            //e.preventDefault();        }else if(this.singleSelect){            this.doSingleSelection(item, index, e);            //e.preventDefault();        }		        return true;    }});Ext.ux.xDataView = Ext.extend(Ext.form.Field, {	 store:             null	,delimiter:         this.delimiter || ','	,title:             this.title || ''	,tbar:              this.tbar || null	,displayField:      0	,valueField:        1	,allowBlank:        true	,blankText:         Ext.form.TextField.prototype.blankText	,defaultAutoCreate: {tag: 'input', type: 'hidden', value: ''}	,simpleSelect:      false	,transform:         false	,hideLabel:         this.hideLabel || false 		,initComponent: function(){		Ext.ux.xDataView.superclass.initComponent.apply(this, arguments);		if(this.transform){			this.allowDomMove = false;		}	}		,onRender: function( ct, position ){		Ext.ux.xDataView.superclass.onRender.apply( this, arguments );		var cls = 'ux-select';				var panel = new Ext.Panel({			 renderTo	: ct			,title		: this.title			,tbar		: this.tbar			,border		: this.border || false			,autoScroll	: true			,autoWidth	: this.autoWidth			,autoHeight	: this.autoHeight			,cls		: cls + '-panel'		});				this.resizeEl = panel;		this.view = new Eve.DataView({			 store			: this.store			,tpl			: this.tpl			,multiSelect	: this.multiSelect			,singleSelect	: this.singleSelect			,simpleSelect	: this.simpleSelect			,selectedClass	: this.selectedClass || cls + '-selected'			,overClass		: this.overClass || cls + '-item-over'			,itemSelector	: this.itemSelector || 'div.' + cls + '-item'		});				this.view.on( 'click', this.onViewClick, this );		this.relayEvents(this.view, ['beforeclick', 'click', 'mouseenter', 'mouseleave', 'containerclick', 'dblclick', 'contextmenu', 'containercontextmenu', 'selectionchange', 'beforeselect'])				panel.add(this.view);		panel.doLayout();		// Important		this.view.getEl().dom.tabIndex = 0;		var parent = this.view.getEl().parent();		parent.setStyle('overflow-x', 'hidden');		if (this.keyMapField) {			var keymap = new Ext.KeyMap(this.view.getEl(), {				key		: 'abcdefghijklmnopqrstuvwxyz'				,handler: function(keyCode, e) {										var idx = this.view.store.findBy(function(record, id) {						var val = record.get( this.keyMapField );						val = val.substr(0, 1).toLowerCase();						if (val == String.fromCharCode(keyCode).toLowerCase()) {							return true;						}					}, this)					if (idx != '-1') {						this.view.select(idx);						this.view.getNode(idx).scrollIntoView();					}				}				,scope	: this			})		}		var keyNav = new Ext.KeyNav(this.view.getEl(), {			"up" : function(e) {				var idx = this.view.getSelectedIndexes()[0];				if (idx > 0) {					this.view.select(idx - 1);					this.view.getNode(idx - 1).scrollIntoView();				}			}			,"down" : function(e) {				var idx = this.view.getSelectedIndexes()[0];				if (idx < this.view.store.getCount() - 1) {					this.view.select(idx + 1);					this.view.getNode(idx + 1).scrollIntoView();				}			}			,scope : this		});	}		,onViewClick: function( view, index, item, e ){		this.el.dom.value = this.getValue();		this.validate();	}		,getValue: function( valueFields ){		if( valueFields ){			var value = [];			var r = this.view.store.data.items;			for( i in r ){				if( i != 'remove' ){					var v = {};				    for( j in valueFields ){						if( j != 'remove' ){ 							v[valueFields[j]] = r[i].get( valueFields[j] );					}}					value.push( v );			}}			return value;		}		if( this.store.data.length == 0 ) return '';		var value = [];		for( var i = 0, len = this.store.data.length; i < len; ++i ){			value.push( this.store.data.items[i].data );		}		return value;	}		,setValue: function( value ){		Ext.ux.xDataView.superclass.setValue.apply( this, arguments );				if(!value){			this.view.clearSelections();		}else{			if(typeof value == 'string') value = value.split( this.delimiter );			var index, q, vf = this.valueField, select = [];			for(var i = 0, len = value.length; i < len; ++i){				q = this.view.store.query(vf, new RegExp( '^' + value[i] + '$', 'i' ));				index = this.view.store.indexOf(q.itemAt( 0 ));				select.push( index );			}			this.view.select( select );		}	}		,validateValue: function(value){		if(value.length < 1){ // no item selected			if( this.allowBlank ){				this.clearInvalid();				return true;			}else{				this.markInvalid( this.blankText );				return false;			}		}		return true;	}		,onEnable: function(){		Ext.ux.xDataView.superclass.onEnable.apply( this, arguments );		this.el.disabled = false;		this.view.enable();	}		,onDisable: function(){		Ext.ux.xDataView.superclass.onDisable.apply( this, arguments );		this.el.disabled = true;		this.view.disable();	}		,selectAll: function(){		var c = this.view.all.getCount();		this.view.selectRange( 0, c-1 );		this.el.dom.value = this.getValue();		this.validate();	}		,clear: function(){		this.setValue();	}	});Ext.reg( 'xdataview', Ext.ux.xDataView );/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/xButton.js *//*--------------------------------------------------*/Ext.ux.xButton = Ext.extend(Ext.form.Field, {    /**     * Read-only. True if this button is hidden     * @type Boolean     */    hidden : false,    /**     * Read-only. True if this button is disabled     * @type Boolean     */    disabled : false,    /**     * Read-only. True if this button is pressed (only if enableToggle = true)     * @type Boolean     */    pressed : false,    /**     * The Button's owner {@link Ext.Panel} (defaults to undefined, and is set automatically when     * the Button is added to a container).  Read-only.     * @type Ext.Panel     * @property ownerCt     */    /**     * @cfg {Number} tabIndex Set a DOM tabIndex for this button (defaults to undefined)     */    /**     * @cfg {Boolean} allowDepress     * False to not allow a pressed Button to be depressed (defaults to undefined). Only valid when {@link #enableToggle} is true.     */    /**     * @cfg {Boolean} enableToggle     * True to enable pressed/not pressed toggling (defaults to false)     */    enableToggle: false,    /**     * @cfg {Function} toggleHandler     * Function called when a Button with {@link #enableToggle} set to true is clicked. Two arguments are passed:<ul class="mdetail-params">     * <li><b>button</b> : Ext.Button<div class="sub-desc">this Button object</div></li>     * <li><b>state</b> : Boolean<div class="sub-desc">The next state if the Button, true means pressed.</div></li>     * </ul>     */    /**     * @cfg {Mixed} menu     * Standard menu attribute consisting of a reference to a menu object, a menu id or a menu config blob (defaults to undefined).     */    /**     * @cfg {String} menuAlign     * The position to align the menu to (see {@link Ext.Element#alignTo} for more details, defaults to 'tl-bl?').     */    menuAlign : "tl-bl?",    /**     * @cfg {String} iconCls     * A css class which sets a background image to be used as the icon for this button     */    /**     * @cfg {String} type     * submit, reset or button - defaults to 'button'     */    type : 'button',    // private    menuClassTarget: 'tr',    /**     * @cfg {String} clickEvent     * The type of event to map to the button's event handler (defaults to 'click')     */    clickEvent : 'click',    /**     * @cfg {Boolean} handleMouseEvents     * False to disable visual cues on mouseover, mouseout and mousedown (defaults to true)     */    handleMouseEvents : true,    /**     * @cfg {String} tooltipType     * The type of tooltip to use. Either "qtip" (default) for QuickTips or "title" for title attribute.     */    tooltipType : 'qtip',    buttonSelector : "button:first",    /**     * @cfg {Ext.Template} template (Optional)     * An {@link Ext.Template} with which to create the Button's main element. This Template must     * contain numeric substitution parameter 0 if it is to display the text property. Changing the template could     * require code modifications if required elements (e.g. a button) aren't present.     */    /**     * @cfg {String} cls     * A CSS class string to apply to the button's main element.     */    initComponent : function(){        Ext.ux.xButton.superclass.initComponent.call(this);        this.addEvents(            /**             * @event click             * Fires when this button is clicked             * @param {Button} this             * @param {EventObject} e The click event             */            "click",            /**             * @event toggle             * Fires when the "pressed" state of this button changes (only if enableToggle = true)             * @param {Button} this             * @param {Boolean} pressed             */            "toggle",            /**             * @event mouseover             * Fires when the mouse hovers over the button             * @param {Button} this             * @param {Event} e The event object             */            'mouseover',            /**             * @event mouseout             * Fires when the mouse exits the button             * @param {Button} this             * @param {Event} e The event object             */            'mouseout',            /**             * @event menushow             * If this button has a menu, this event fires when it is shown             * @param {Button} this             * @param {Menu} menu             */            'menushow',            /**             * @event menuhide             * If this button has a menu, this event fires when it is hidden             * @param {Button} this             * @param {Menu} menu             */            'menuhide',            /**             * @event menutriggerover             * If this button has a menu, this event fires when the mouse enters the menu triggering element             * @param {Button} this             * @param {Menu} menu             * @param {EventObject} e             */            'menutriggerover',            /**             * @event menutriggerout             * If this button has a menu, this event fires when the mouse leaves the menu triggering element             * @param {Button} this             * @param {Menu} menu             * @param {EventObject} e             */            'menutriggerout'        );        if(this.menu){            this.menu = Ext.menu.MenuMgr.get(this.menu);        }        if(typeof this.toggleGroup === 'string'){            this.enableToggle = true;        }    },    // private    onRender : function(ct, position){        if(!this.template){            if(!Ext.Button.buttonTemplate){                // hideous table template                Ext.Button.buttonTemplate = new Ext.Template(                    '<table border="0" cellpadding="0" cellspacing="0" class="x-btn-wrap"><tbody><tr>',                    '<td class="x-btn-left"><i>&#160;</i></td><td class="x-btn-center"><em unselectable="on"><button class="x-btn-text" type="{1}">{0}</button></em></td><td class="x-btn-right"><i>&#160;</i></td>',                    "</tr></tbody></table>");            }            this.template = Ext.Button.buttonTemplate;        }        var btn, targs = [this.text || '&#160;', this.type];        if(position){            btn = this.template.insertBefore(position, targs, true);        }else{            btn = this.template.append(ct, targs, true);        }        var btnEl = btn.child(this.buttonSelector);        btnEl.on('focus', this.onFocus, this);        btnEl.on('blur', this.onBlur, this);        this.initButtonEl(btn, btnEl);        if(this.menu){            this.el.child(this.menuClassTarget).addClass("x-btn-with-menu");        }        Ext.ButtonToggleMgr.register(this);    },    // private    initButtonEl : function(btn, btnEl){        this.el = btn;        btn.addClass("x-btn");        if(this.icon){            btnEl.setStyle('background-image', 'url(' +this.icon +')');        }        if(this.iconCls){            btnEl.addClass(this.iconCls);            if(!this.cls){                btn.addClass(this.text ? 'x-btn-text-icon' : 'x-btn-icon');            }        }        if(this.tabIndex !== undefined){            btnEl.dom.tabIndex = this.tabIndex;        }        if(this.tooltip){            if(typeof this.tooltip == 'object'){                Ext.QuickTips.register(Ext.apply({                      target: btnEl.id                }, this.tooltip));            } else {                btnEl.dom[this.tooltipType] = this.tooltip;            }        }        if(this.pressed){            this.el.addClass("x-btn-pressed");        }        if(this.handleMouseEvents){            btn.on("mouseover", this.onMouseOver, this);            // new functionality for monitoring on the document level            //btn.on("mouseout", this.onMouseOut, this);            btn.on("mousedown", this.onMouseDown, this);        }        if(this.menu){            this.menu.on("show", this.onMenuShow, this);            this.menu.on("hide", this.onMenuHide, this);        }        if(this.id){            this.el.dom.id = this.el.id = this.id;        }        if(this.repeat){            var repeater = new Ext.util.ClickRepeater(btn,                typeof this.repeat == "object" ? this.repeat : {}            );            repeater.on("click", this.onClick,  this);        }        btn.on(this.clickEvent, this.onClick, this);    },    // private    afterRender : function(){        Ext.Button.superclass.afterRender.call(this);        if(Ext.isIE6){            this.autoWidth.defer(1, this);        }else{            this.autoWidth();        }    },    /**     * Sets the CSS class that provides a background image to use as the button's icon.  This method also changes     * the value of the {@link iconCls} config internally.     * @param {String} cls The CSS class providing the icon image     */    setIconClass : function(cls){        if(this.el){            this.el.child(this.buttonSelector).replaceClass(this.iconCls, cls);        }        this.iconCls = cls;    },    // private    beforeDestroy: function(){    	if(this.rendered){	        var btn = this.el.child(this.buttonSelector);	        if(btn){	            btn.removeAllListeners();	        }	    }        if(this.menu){            Ext.destroy(this.menu);        }    },    // private    onDestroy : function(){        if(this.rendered){            Ext.ButtonToggleMgr.unregister(this);        }    },    // private    autoWidth : function(){        if(this.el){            this.el.setWidth("auto");            if(Ext.isIE7 && Ext.isStrict){                var ib = this.el.child(this.buttonSelector);                if(ib && ib.getWidth() > 20){                    ib.clip();                    ib.setWidth(Ext.util.TextMetrics.measure(ib, this.text).width+ib.getFrameWidth('lr'));                }            }            if(this.minWidth){                if(this.el.getWidth() < this.minWidth){                    this.el.setWidth(this.minWidth);                }            }        }    },    /**     * Assigns this button's click handler     * @param {Function} handler The function to call when the button is clicked     * @param {Object} scope (optional) Scope for the function passed in     */    setHandler : function(handler, scope){        this.handler = handler;        this.scope = scope;    },    /**     * Sets this button's text     * @param {String} text The button text     */    setText : function(text){        this.text = text;        if(this.el){            this.el.child("td.x-btn-center " + this.buttonSelector).update(text);        }        this.autoWidth();    },    /**     * Gets the text for this button     * @return {String} The button text     */    getText : function(){        return this.text;    },    /**     * If a state it passed, it becomes the pressed state otherwise the current state is toggled.     * @param {Boolean} state (optional) Force a particular state     */    toggle : function(state){        state = state === undefined ? !this.pressed : state;        if(state != this.pressed){            if(state){                this.el.addClass("x-btn-pressed");                this.pressed = true;                this.fireEvent("toggle", this, true);            }else{                this.el.removeClass("x-btn-pressed");                this.pressed = false;                this.fireEvent("toggle", this, false);            }            if(this.toggleHandler){                this.toggleHandler.call(this.scope || this, this, state);            }        }    },    /**     * Focus the button     */    focus : function(){        this.el.child(this.buttonSelector).focus();    },    // private    onDisable : function(){        if(this.el){            if(!Ext.isIE6 || !this.text){                this.el.addClass(this.disabledClass);            }            this.el.dom.disabled = true;        }        this.disabled = true;    },    // private    onEnable : function(){        if(this.el){            if(!Ext.isIE6 || !this.text){                this.el.removeClass(this.disabledClass);            }            this.el.dom.disabled = false;        }        this.disabled = false;    },    /**     * Show this button's menu (if it has one)     */    showMenu : function(){        if(this.menu){            this.menu.show(this.el, this.menuAlign);        }        return this;    },    /**     * Hide this button's menu (if it has one)     */    hideMenu : function(){        if(this.menu){            this.menu.hide();        }        return this;    },    /**     * Returns true if the button has a menu and it is visible     * @return {Boolean}     */    hasVisibleMenu : function(){        return this.menu && this.menu.isVisible();    },    // private    onClick : function(e){        if(e){            e.preventDefault();        }        if(e.button != 0){            return;        }        if(!this.disabled){            if(this.enableToggle && (this.allowDepress !== false || !this.pressed)){                this.toggle();            }            if(this.menu && !this.menu.isVisible() && !this.ignoreNextClick){                this.showMenu();            }            this.fireEvent("click", this, e);            if(this.handler){                //this.el.removeClass("x-btn-over");                this.handler.call(this.scope || this, this, e);            }        }    },    // private    isMenuTriggerOver : function(e, internal){        return this.menu && !internal;    },    // private    isMenuTriggerOut : function(e, internal){        return this.menu && !internal;    },    // private    onMouseOver : function(e){        if(!this.disabled){            var internal = e.within(this.el,  true);            if(!internal){                this.el.addClass("x-btn-over");                if(!this.monitoringMouseOver){                    Ext.getDoc().on('mouseover', this.monitorMouseOver, this);                    this.monitoringMouseOver = true;                }                this.fireEvent('mouseover', this, e);            }            if(this.isMenuTriggerOver(e, internal)){                this.fireEvent('menutriggerover', this, this.menu, e);            }        }    },    // private    monitorMouseOver : function(e){        if(e.target != this.el.dom && !e.within(this.el)){            if(this.monitoringMouseOver){                Ext.getDoc().un('mouseover', this.monitorMouseOver, this);                this.monitoringMouseOver = false;            }            this.onMouseOut(e);        }    },    // private    onMouseOut : function(e){        var internal = e.within(this.el) && e.target != this.el.dom;        this.el.removeClass("x-btn-over");        this.fireEvent('mouseout', this, e);        if(this.isMenuTriggerOut(e, internal)){            this.fireEvent('menutriggerout', this, this.menu, e);        }    },    // private    onFocus : function(e){        if(!this.disabled){            this.el.addClass("x-btn-focus");        }    },    // private    onBlur : function(e){        this.el.removeClass("x-btn-focus");    },    // private    getClickEl : function(e, isUp){       return this.el;    },    // private    onMouseDown : function(e){        if(!this.disabled && e.button == 0){            this.getClickEl(e).addClass("x-btn-click");            Ext.getDoc().on('mouseup', this.onMouseUp, this);        }    },    // private    onMouseUp : function(e){        if(e.button == 0){            this.getClickEl(e, true).removeClass("x-btn-click");            Ext.getDoc().un('mouseup', this.onMouseUp, this);        }    },    // private    onMenuShow : function(e){        this.ignoreNextClick = 0;        this.el.addClass("x-btn-menu-active");        this.fireEvent('menushow', this, this.menu);    },    // private    onMenuHide : function(e){        this.el.removeClass("x-btn-menu-active");        this.ignoreNextClick = this.restoreClick.defer(250, this);        this.fireEvent('menuhide', this, this.menu);    },    // private    restoreClick : function(){        this.ignoreNextClick = 0;    }    /**     * @cfg {String} autoEl @hide     */});Ext.reg('xbutton', Ext.ux.xButton);/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/BrowseButton.js *//*--------------------------------------------------*/Ext.namespace('Ext.ux.form');// @author 4Himif(typeof Ext.isIE8 != 'boolean') { // Ext 2.x (at least 2.1) doesn't know IE8. Let's tell him about it...    Ext.isIE8 = Ext.isIE && navigator.userAgent.toLowerCase().indexOf("msie 8")>-1;}/** * @class Ext.ux.form.BrowseButton * @extends Ext.Button * Ext.Button that provides a customizable file browse button. * Clicking this button, pops up a file dialog box for a user to select the file to upload. * This is accomplished by having a transparent <input type="file"> box above the Ext.Button. * When a user thinks he or she is clicking the Ext.Button, they're actually clicking the hidden input "Browse..." box. * Note: this class can be instantiated explicitly or with xtypes anywhere a regular Ext.Button can be except in 2 scenarios: * - Panel.addButton method both as an instantiated object or as an xtype config object. * - Panel.buttons config object as an xtype config object. * These scenarios fail because Ext explicitly creates an Ext.Button in these cases. * Browser compatibility: * Internet Explorer 6: * - no issues * Internet Explorer 7: * - no issues * Internet Explorer 8: * - no issues * Firefox 3 - Windows: * - pointer cursor doesn't display when hovering over the button. * @author loeppky - based on the work done by MaximGB in Ext.ux.UploadDialog (http://extjs.com/forum/showthread.php?t=21558) * The follow the curosr float div idea also came from MaximGB. With patches for IE8 by 4Him. * @see http://extjs.com/forum/showthread.php?t=29032 * @constructor * Create a new BrowseButton. * @param {Object} config Configuration options */Ext.ux.form.BrowseButton = Ext.extend(Ext.Button, {    /*     * Config options:     */    /**     * @cfg {String} inputFileName     * Name to use for the hidden input file DOM element.  Deaults to "file".     */    inputFileName: 'file',    /**     * @cfg {Boolean} debug     * Toggle for turning on debug mode.     * Debug mode doesn't make clipEl transparent so that one can see how effectively it covers the Ext.Button.     * In addition, clipEl is given a green background and floatEl a red background to see how well they are positioned.     */    debug: false,            /*     * Private constants:     */    /**     * @property FLOAT_EL_WIDTH     * @type Number     * The width (in pixels) of floatEl.     * It should be less than the width of the IE "Browse" button's width (65 pixels), since IE doesn't let you resize it.     * We define this width so we can quickly center floatEl at the mouse cursor without having to make any function calls.     * @private     */    FLOAT_EL_WIDTH: 60,        /**     * @property FLOAT_EL_HEIGHT     * @type Number     * The heigh (in pixels) of floatEl.     * It should be less than the height of the "Browse" button's height.     * We define this height so we can quickly center floatEl at the mouse cursor without having to make any function calls.     * @private     */    FLOAT_EL_HEIGHT: 18,            /*     * Private properties:     */    /**     * @property buttonCt     * @type Ext.Element     * Element that contains the actual Button DOM element.     * We store a reference to it, so we can easily grab its size for sizing the clipEl.     * @private     */    buttonCt: null,    /**     * @property clipEl     * @type Ext.Element     * Element that contains the floatEl.     * This element is positioned to fill the area of Ext.Button and has overflow turned off.     * This keeps floadEl tight to the Ext.Button, and prevents it from masking surrounding elements.     * @private     */    clipEl: null,    /**     * @property floatEl     * @type Ext.Element     * Element that contains the inputFileEl.     * This element is size to be less than or equal to the size of the input file "Browse" button.     * It is then positioned wherever the user moves the cursor, so that their click always clicks the input file "Browse" button.     * Overflow is turned off to preven inputFileEl from masking surrounding elements.     * @private     */    floatEl: null,    /**     * @property inputFileEl     * @type Ext.Element     * Element for the hiden file input.     * @private     */    inputFileEl: null,    /**     * @property originalHandler     * @type Function     * The handler originally defined for the Ext.Button during construction using the "handler" config option.     * We need to null out the "handler" property so that it is only called when a file is selected.     * @private     */    originalHandler: null,    /**     * @property originalScope     * @type Object     * The scope originally defined for the Ext.Button during construction using the "scope" config option.     * While the "scope" property doesn't need to be nulled, to be consistent with originalHandler, we do.     * @private     */    originalScope: null,    /**     * @property BROWSERS_OFFSET     * @type Object     * The browsers specific offsets used to position the clipping element for better overlay tightness. For     * Ext 3, Ext 2 offsets are used unless there is an Ext 3 entry.     * @private     * @author 4Him     */    BROWSERS_OFFSETS: {        Ext2: {            IE8:   {left: -8, top: -16, width: 16,  height: 22},            IE:    {left: -8, top: -3,  width: 16,  height: 6},            Opera: {left: -8, top: -3,  width: -18, height: -1},            Gecko: {left: -8, top: -6,  width: 16,  height: 10},            Safari:{left: -4, top: -2,  width: 6,   height: 6}        },        Ext3: {            IE8:   {left: -7,           width: 10},            IE:    {left: -3,           width: 6},            Gecko: {                    width: 11}        }    },    /**     * @property isExt2x     * @type boolean     * Whether we are currently using Ext 2.x     * @private     * @author 4Him     */    isExt2x: Ext.version.match(/^2\./),            /*     * Protected Ext.Button overrides     */    /**     * @see Ext.Button.initComponent     */    initComponent: function(){        Ext.ux.form.BrowseButton.superclass.initComponent.call(this);        // Store references to the original handler and scope before nulling them.        // This is done so that this class can control when the handler is called.        // There are some cases where the hidden file input browse button doesn't completely cover the Ext.Button.        // The handler shouldn't be called in these cases.  It should only be called if a new file is selected on the file system.          this.originalHandler = this.handler;        this.originalScope = this.scope;        this.handler = null;        this.scope = null;    },        /**     * @see Ext.Button.onRender     */    onRender: function(ct, position){        Ext.ux.form.BrowseButton.superclass.onRender.call(this, ct, position); // render the Ext.Button        // Patch for compatibility with 3.x (@author 4Him, based on dario's 05-10-2009 post)        if(this.isExt2x) {            this.buttonCt = this.el.child('.x-btn-center em');        } else {            this.buttonCt = this.el.child('.x-btn-mc em');        }        this.buttonCt.position('relative'); // this is important!        var styleCfg = {            position: 'absolute',            overflow: 'hidden',            top: '0px', // default            left: '0px' // default        };        // browser specifics for better overlay tightness - modified by 4Him        for(var browser in this.BROWSERS_OFFSETS.Ext2) {            if(Ext['is'+browser]) {                Ext.apply(styleCfg, {                    left: this.getBrowserOffset(browser, 'left')+'px',                    top: this.getBrowserOffset(browser, 'top')+'px'                });                break;            }        }        this.clipEl = this.buttonCt.createChild({            tag: 'div',            style: styleCfg        });        this.setClipSize();        this.clipEl.on({            'mousemove': this.onButtonMouseMove,            'mouseover': this.onButtonMouseMove,            scope: this        });                this.floatEl = this.clipEl.createChild({            tag: 'div',            style: {                position: 'absolute',                width: this.FLOAT_EL_WIDTH + 'px',                height: this.FLOAT_EL_HEIGHT + 'px',                overflow: 'hidden'            }        });                        if (this.debug) {            this.clipEl.applyStyles({                'background-color': 'green'            });            this.floatEl.applyStyles({                'background-color': 'red'            });        } else {            // We don't set the clipEl to be transparent, because IE 6/7 occassionaly looses mouse events for transparent elements.            // We have listeners on the clipEl that can't be lost as they're needed for realligning the input file element.            this.floatEl.setOpacity(0.0);        }                // Cover cases where someone tabs to the button:        // Listen to focus of the button so we can translate the focus to the input file el.        var buttonEl = this.el.child(this.buttonSelector);        buttonEl.on('focus', this.onButtonFocus, this);        // In IE, it's possible to tab to the text portion of the input file el.          // We want to listen to keyevents so that if a space is pressed, we "click" the input file el.        if (Ext.isIE) {            this.el.on('keydown', this.onButtonKeyDown, this);        }                this.createInputFile();    },            /*     * Private helper methods:     */    /**     * Returns an offset based on this.BROWSERS_OFFSET      * If currently using Ext 3.x, tries to find a value for 3.x and if there is none for 3.x, it     * returns a value for 2.x     * @param {string} the desired offset. Can be one of the following: 'left', 'top', 'width', 'height'      * @param {string} browser the browser for which to return the offset     * @return {int} the desired offset     * @author 4Him     */    getBrowserOffset: function(browser, which) {        if(!this.isExt2x && this.BROWSERS_OFFSETS.Ext3[browser] && this.BROWSERS_OFFSETS.Ext3[browser][which]) {            return this.BROWSERS_OFFSETS.Ext3[browser][which];        } else {            return this.BROWSERS_OFFSETS.Ext2[browser][which];        }    },    /**     * Sets the size of clipEl so that is covering as much of the button as possible.     * @private     */    setClipSize: function(){        if (this.clipEl) {            var width = this.buttonCt.getWidth();            var height = this.buttonCt.getHeight();            // The button container can have a width and height of zero when it's rendered in a hidden panel.            // This is most noticable when using a card layout, as the items are all rendered but hidden,            // (unless deferredRender is set to true).             // In this case, the clip size can't be determined, so we attempt to set it later.            // This check repeats until the button container has a size.             if (width === 0 || (height === 0 && !Ext.isIE8)) {  // ugly hack (Ext.isIE8) by 4Him                this.setClipSize.defer(100, this);            } else {                // Loop by 4Him                for(var browser in this.BROWSERS_OFFSETS.Ext2) {                    if(Ext['is'+browser]) {                        width = width + this.getBrowserOffset(browser, 'width');                        height = height + this.getBrowserOffset(browser, 'height');                        break;                    }                }                this.clipEl.setSize(width, height);            }        }    },        /**     * Creates the input file element and adds it to inputFileCt.     * The created input file elementis sized, positioned, and styled appropriately.     * Event handlers for the element are set up, and a tooltip is applied if defined in the original config.     * @private     */    createInputFile: function(){        // When an input file gets detached and set as the child of a different DOM element,        // straggling <em> elements get left behind.          // I don't know why this happens but we delete any <em> elements we can find under the floatEl to prevent a memory leak.        this.floatEl.select('em').each(function(el){            el.remove();        });        this.inputFileEl = this.floatEl.createChild({            tag: 'input',            type: 'file',            size: 1, // must be > 0. It's value doesn't really matter due to our masking div (inputFileCt).              name: this.inputFileName || Ext.id(this.el),            tabindex: this.tabIndex,            // Use the same pointer as an Ext.Button would use.  This doesn't work in Firefox.            // This positioning right-aligns the input file to ensure that the "Browse" button is visible.            style: {                position: 'absolute',                cursor: 'pointer',                right: '0px',                top: '0px'            }        });        this.inputFileEl = this.inputFileEl.child('input') || this.inputFileEl;        // IE8 needs opacity on the 'file input' element - @author 4Him        if(Ext.isIE8) {            this.inputFileEl.setOpacity(0.0);        }                // setup events        this.inputFileEl.on({            'click': this.onInputFileClick,            'change': this.onInputFileChange,            'focus': this.onInputFileFocus,            'select': this.onInputFileFocus,            'blur': this.onInputFileBlur,            scope: this        });                // add a tooltip        if (this.tooltip) {            if (typeof this.tooltip == 'object') {                Ext.QuickTips.register(Ext.apply({                    target: this.inputFileEl                }, this.tooltip));            } else {                this.inputFileEl.dom[this.tooltipType] = this.tooltip;            }        }    },        /**     * Redirecting focus to the input file element so the user can press space and select files.     * @param {Event} e focus event.     * @private     */    onButtonFocus: function(e){        if (this.inputFileEl) {            this.inputFileEl.focus();            e.stopEvent();        }    },        /**     * Handler for the IE case where once can tab to the text box of an input file el.     * If the key is a space, we simply "click" the inputFileEl.     * @param {Event} e key event.     * @private     */    onButtonKeyDown: function(e){        if (this.inputFileEl && e.getKey() == Ext.EventObject.SPACE) {            this.inputFileEl.dom.click();            e.stopEvent();        }    },        /**     * Handler when the cursor moves over the clipEl.     * The floatEl gets centered to the cursor location.     * @param {Event} e mouse event.     * @private     */    onButtonMouseMove: function(e){        var xy = e.getXY();        xy[0] -= this.FLOAT_EL_WIDTH / 2;        xy[1] -= this.FLOAT_EL_HEIGHT / 2;        this.floatEl.setXY(xy);    },        /**     * Add the visual enhancement to the button when the input file recieves focus.      * This is the tip for the user that now he/she can press space to select the file.     * @private     */    onInputFileFocus: function(e){        if (!this.isDisabled) {            this.el.addClass("x-btn-over");        }    },        /**     * Removes the visual enhancement from the button.     * @private     */    onInputFileBlur: function(e){        this.el.removeClass("x-btn-over");    },        /**     * Handler when inputFileEl's "Browse..." button is clicked.     * @param {Event} e click event.     * @private     */    onInputFileClick: function(e){        e.stopPropagation();    },        /**     * Handler when inputFileEl changes value (i.e. a new file is selected).     * @private     */    onInputFileChange: function(){        if (this.originalHandler) {            this.originalHandler.call(this.originalScope, this);        }    },            /*     * Public methods:     */    /**     * Detaches the input file associated with this BrowseButton so that it can be used for other purposed (e.g. uplaoding).     * The returned input file has all listeners and tooltips applied to it by this class removed.     * @param {Boolean} whether to create a new input file element for this BrowseButton after detaching.     * True will prevent creation.  Defaults to false.     * @return {Ext.Element} the detached input file element.     */    detachInputFile: function(noCreate){        var result = this.inputFileEl;                if (typeof this.tooltip == 'object') {            Ext.QuickTips.unregister(this.inputFileEl);        } else {            this.inputFileEl.dom[this.tooltipType] = null;        }        this.inputFileEl.removeAllListeners();        this.inputFileEl = null;                if (!noCreate) {            this.createInputFile();        }        return result;    },        /**     * @return {Ext.Element} the input file element attached to this BrowseButton.     */    getInputFile: function(){        return this.inputFileEl;    },        /**     * @see Ext.Button.disable     */    disable: function(){        Ext.ux.form.BrowseButton.superclass.disable.call(this);        this.inputFileEl.dom.disabled = true;    },        /**     * @see Ext.Button.enable     */    enable: function(){        Ext.ux.form.BrowseButton.superclass.enable.call(this);        this.inputFileEl.dom.disabled = false;    }});Ext.reg('browsebutton', Ext.ux.form.BrowseButton);/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/xLabel.js *//*--------------------------------------------------*/Ext.ux.xLabel = Ext.extend(Ext.form.Field,{    /**     * @cfg {String} text The plain text to display within the label (defaults to ''). If you need to include HTML     * tags within the label's innerHTML, use the {@link #html} config instead.     */    /**     * @cfg {String} forId The id of the input element to which this label will be bound via the standard 'htmlFor'     * attribute. If not specified, the attribute will not be added to the label.     */    /**     * @cfg {String} html An HTML fragment that will be used as the label's innerHTML (defaults to '').     * Note that if {@link #text} is specified it will take precedence and this value will be ignored.     */    // private    onRender : function(ct, position){        if(!this.el){            this.el = document.createElement('label');            this.el.id = this.getId();            this.el.innerHTML = this.text ? Ext.util.Format.htmlEncode(this.text) : (this.html || '');            if(this.forId){                this.el.setAttribute('htmlFor', this.forId);            }        }        Ext.form.Label.superclass.onRender.call(this, ct, position);    },    /**     * Updates the label's innerHTML with the specified string.     * @param {String} text The new label text     * @param {Boolean} encode (optional) False to skip HTML-encoding the text when rendering it     * to the label (defaults to true which encodes the value). This might be useful if you want to include     * tags in the label's innerHTML rather than rendering them as string literals per the default logic.     * @return {Label} this     */    setText: function(t, encode){        this.text = t;        if(this.rendered){            this.el.dom.innerHTML = encode !== false ? Ext.util.Format.htmlEncode(t) : t;        }        return this;    }    ,getValue : function(){}    ,setValue : function(){}});Ext.reg('xlabel', Ext.form.Label);/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/Spinner.js *//*--------------------------------------------------*//** * Copyright (c) 2008, Steven Chim * All rights reserved. *  * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: *  *     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. *     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. *     * The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. *  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *//**  * Ext.ux.form.Spinner Class	*	* @author  Steven Chim	* @version Spinner.js 2008-08-27 v0.35  *  * @class Ext.ux.form.Spinner  * @extends Ext.form.TriggerField  */Ext.namespace("Ext.ux.form");Ext.ux.form.Spinner = function(config){	Ext.ux.form.Spinner.superclass.constructor.call(this, config);	this.addEvents({		'spin' : true,		'spinup' : true,		'spindown' : true	});}Ext.extend(Ext.ux.form.Spinner, Ext.form.TriggerField, {	triggerClass : 'x-form-spinner-trigger',	splitterClass : 'x-form-spinner-splitter',	alternateKey : Ext.EventObject.shiftKey,	strategy : undefined,	//private	onRender : function(ct, position){		Ext.ux.form.Spinner.superclass.onRender.call(this, ct, position);		this.splitter = this.wrap.createChild({tag:'div', cls:this.splitterClass, style:'width:13px; height:2px;'});		this.splitter.show().setRight( (Ext.isIE) ? 1 : 2 );		this.splitter.show().setTop(10);		this.proxy = this.trigger.createProxy('', this.splitter, true);		this.proxy.addClass("x-form-spinner-proxy");		this.proxy.setStyle('left','0px');  		this.proxy.setSize(14, 1);		this.proxy.hide();		this.dd = new Ext.dd.DDProxy(this.splitter.dom.id, "SpinnerDrag", {dragElId: this.proxy.id});		this.initSpinner();	},	//private	initTrigger : function(){		this.trigger.addClassOnOver('x-form-trigger-over');		this.trigger.addClassOnClick('x-form-trigger-click');	},	//private	initSpinner : function(){		this.keyNav = new Ext.KeyNav(this.el, {			"up" : function(e){				e.preventDefault();				this.onSpinUp();			},			"down" : function(e){				e.preventDefault();				this.onSpinDown();			},			"pageUp" : function(e){				e.preventDefault();				this.onSpinUpAlternate();			},			"pageDown" : function(e){				e.preventDefault();				this.onSpinDownAlternate();			},			scope : this		});		this.repeater = new Ext.util.ClickRepeater(this.trigger);		this.repeater.on("click", this.onTriggerClick, this, {preventDefault:true});		this.trigger.on("mouseover", this.onMouseOver, this, {preventDefault:true});		this.trigger.on("mouseout",  this.onMouseOut,  this, {preventDefault:true});		this.trigger.on("mousemove", this.onMouseMove, this, {preventDefault:true});		this.trigger.on("mousedown", this.onMouseDown, this, {preventDefault:true});		this.trigger.on("mouseup",   this.onMouseUp,   this, {preventDefault:true});		this.wrap.on("mousewheel",   this.handleMouseWheel, this);		this.dd.setXConstraint(0, 0, 10)		this.dd.setYConstraint(1500, 1500, 10);		this.dd.endDrag = this.endDrag.createDelegate(this);		this.dd.startDrag = this.startDrag.createDelegate(this);		this.dd.onDrag = this.onDrag.createDelegate(this);        /*        jsakalos suggestion        http://extjs.com/forum/showthread.php?p=121850#post121850 */        if('object' == typeof this.strategy && this.strategy.xtype) {            switch(this.strategy.xtype) {                case 'number':                    this.strategy = new Ext.ux.form.Spinner.NumberStrategy(this.strategy);	                break;                case 'date':                    this.strategy = new Ext.ux.form.Spinner.DateStrategy(this.strategy);	                break;                case 'time':                    this.strategy = new Ext.ux.form.Spinner.TimeStrategy(this.strategy);                	break;                default:                    delete(this.strategy);                	break;            }            delete(this.strategy.xtype);        }		if(this.strategy == undefined){			this.strategy = new Ext.ux.form.Spinner.NumberStrategy();		}	},	//private	onMouseOver : function(){		if(this.disabled){			return;		}		var middle = this.getMiddle();		this.__tmphcls = (Ext.EventObject.getPageY() < middle) ? 'x-form-spinner-overup' : 'x-form-spinner-overdown';		this.trigger.addClass(this.__tmphcls);	},	//private	onMouseOut : function(){		this.trigger.removeClass(this.__tmphcls);	},	//private	onMouseMove : function(){		if(this.disabled){			return;		}		var middle = this.getMiddle();		if( ((Ext.EventObject.getPageY() > middle) && this.__tmphcls == "x-form-spinner-overup") ||			((Ext.EventObject.getPageY() < middle) && this.__tmphcls == "x-form-spinner-overdown")){		}	},	//private	onMouseDown : function(){		if(this.disabled){			return;		}		var middle = this.getMiddle();		this.__tmpccls = (Ext.EventObject.getPageY() < middle) ? 'x-form-spinner-clickup' : 'x-form-spinner-clickdown';		this.trigger.addClass(this.__tmpccls);	},	//private	onMouseUp : function(){		this.trigger.removeClass(this.__tmpccls);	},	//private	onTriggerClick : function(){		if(this.disabled || this.getEl().dom.readOnly){			return;		}		var middle = this.getMiddle();		var ud = (Ext.EventObject.getPageY() < middle) ? 'Up' : 'Down';		this['onSpin'+ud]();	},	//private	getMiddle : function(){		var t = this.trigger.getTop();		var h = this.trigger.getHeight();		var middle = t + (h/2);		return middle;	},		//private	//checks if control is allowed to spin	isSpinnable : function(){		if(this.disabled || this.getEl().dom.readOnly){			Ext.EventObject.preventDefault();	//prevent scrolling when disabled/readonly			return false;		}		return true;	},	handleMouseWheel : function(e){		//disable scrolling when not focused		if(this.wrap.hasClass('x-trigger-wrap-focus') == false){			return;		}		var delta = e.getWheelDelta();		if(delta > 0){			this.onSpinUp();			e.stopEvent();		} else if(delta < 0){			this.onSpinDown();			e.stopEvent();		}	},	//private	startDrag : function(){		this.proxy.show();		this._previousY = Ext.fly(this.dd.getDragEl()).getTop();	},	//private	endDrag : function(){		this.proxy.hide();	},	//private	onDrag : function(){		if(this.disabled){			return;		}		var y = Ext.fly(this.dd.getDragEl()).getTop();		var ud = '';		if(this._previousY > y){ud = 'Up';}         //up		if(this._previousY < y){ud = 'Down';}       //down		if(ud != ''){			this['onSpin'+ud]();		}		this._previousY = y;	},	//private	onSpinUp : function(){		if(this.isSpinnable() == false) {			return;		}		if(Ext.EventObject.shiftKey == true){			this.onSpinUpAlternate();			return;		}else{			this.strategy.onSpinUp(this);		}		this.fireEvent("spin", this);		this.fireEvent("spinup", this);	},	//private	onSpinDown : function(){		if(this.isSpinnable() == false) {			return;		}		if(Ext.EventObject.shiftKey == true){			this.onSpinDownAlternate();			return;		}else{			this.strategy.onSpinDown(this);		}		this.fireEvent("spin", this);		this.fireEvent("spindown", this);	},	//private	onSpinUpAlternate : function(){		if(this.isSpinnable() == false) {			return;		}		this.strategy.onSpinUpAlternate(this);		this.fireEvent("spin", this);		this.fireEvent("spinup", this);	},	//private	onSpinDownAlternate : function(){		if(this.isSpinnable() == false) {			return;		}		this.strategy.onSpinDownAlternate(this);		this.fireEvent("spin", this);		this.fireEvent("spindown", this);	}});Ext.reg('uxspinner', Ext.ux.form.Spinner);/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/SpinnerStrategy.js *//*--------------------------------------------------*//** * Copyright (c) 2008, Steven Chim * All rights reserved. *  * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: *  *     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. *     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. *     * The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. *  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *//*** * Abstract Strategy */Ext.ux.form.Spinner.Strategy = function(config){	Ext.apply(this, config);};Ext.extend(Ext.ux.form.Spinner.Strategy, Ext.util.Observable, {	defaultValue : 0,	minValue : undefined,	maxValue : undefined,	incrementValue : undefined,	alternateIncrementValue : 5,	validationTask : new Ext.util.DelayedTask(),		onSpinUp : function(field){		this.spin(field, false, false);	},	onSpinDown : function(field){		this.spin(field, true, false);	},	onSpinUpAlternate : function(field){		this.spin(field, false, true);	},	onSpinDownAlternate : function(field){		this.spin(field, true, true);	},	spin : function(field, down, alternate){		this.validationTask.delay(500, function(){field.validate()});		//extend	},	fixBoundries : function(value){		return value;		//overwrite	}	});/*** * Concrete Strategy: Numbers */Ext.ux.form.Spinner.NumberStrategy = function(config){	Ext.ux.form.Spinner.NumberStrategy.superclass.constructor.call(this, config);};Ext.extend(Ext.ux.form.Spinner.NumberStrategy, Ext.ux.form.Spinner.Strategy, {    allowDecimals : true,    decimalPrecision : 2,    	spin : function(field, down, alternate){		Ext.ux.form.Spinner.NumberStrategy.superclass.spin.call(this, field, down, alternate);		var v = parseFloat(field.getValue());		var incr = (alternate == true) ? this.alternateIncrementValue : this.incrementValue;		(down == true) ? v -= incr : v += incr ;		v = (isNaN(v)) ? this.defaultValue : v;		v = this.fixBoundries(v);		field.setRawValue(v);	},	fixBoundries : function(value){		var v = value;		if(this.minValue != undefined && v < this.minValue){			v = this.minValue;		}		if(this.maxValue != undefined && v > this.maxValue){			v = this.maxValue;		}		return this.fixPrecision(v);	},	    // private    fixPrecision : function(value){        var nan = isNaN(value);        if(!this.allowDecimals || this.decimalPrecision == -1 || nan || !value){            return nan ? '' : value;        }        return parseFloat(parseFloat(value).toFixed(this.decimalPrecision));    }});/*** * Concrete Strategy: Date */Ext.ux.form.Spinner.DateStrategy = function(config){	Ext.ux.form.Spinner.DateStrategy.superclass.constructor.call(this, config);};Ext.extend(Ext.ux.form.Spinner.DateStrategy, Ext.ux.form.Spinner.Strategy, {	defaultValue : new Date(),	format : "Y-m-d",	incrementValue : 1,	incrementConstant : Date.DAY,	alternateIncrementValue : 1,	alternateIncrementConstant : Date.MONTH,	spin : function(field, down, alternate){		Ext.ux.form.Spinner.DateStrategy.superclass.spin.call(this);		var v = field.getRawValue();				v = Date.parseDate(v, this.format);		var dir = (down == true) ? -1 : 1 ;		var incr = (alternate == true) ? this.alternateIncrementValue : this.incrementValue;		var dtconst = (alternate == true) ? this.alternateIncrementConstant : this.incrementConstant;		if(typeof this.defaultValue == 'string'){			this.defaultValue = Date.parseDate(this.defaultValue, this.format);		}		v = (v) ? v.add(dtconst, dir*incr) : this.defaultValue;		v = this.fixBoundries(v);		field.setRawValue(Ext.util.Format.date(v,this.format));	},		//private	fixBoundries : function(date){		var dt = date;		var min = (typeof this.minValue == 'string') ? Date.parseDate(this.minValue, this.format) : this.minValue ;		var max = (typeof this.maxValue == 'string') ? Date.parseDate(this.maxValue, this.format) : this.maxValue ;		if(this.minValue != undefined && dt < min){			dt = min;		}		if(this.maxValue != undefined && dt > max){			dt = max;		}		return dt;	}});/*** * Concrete Strategy: Time */Ext.ux.form.Spinner.TimeStrategy = function(config){	Ext.ux.form.Spinner.TimeStrategy.superclass.constructor.call(this, config);};Ext.extend(Ext.ux.form.Spinner.TimeStrategy, Ext.ux.form.Spinner.DateStrategy, {	format : "H:i",	incrementValue : 1,	incrementConstant : Date.MINUTE,	alternateIncrementValue : 1,	alternateIncrementConstant : Date.HOUR});/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/FileUploadField.js *//*--------------------------------------------------*//* * Ext JS Library 3.0 RC1 * Copyright(c) 2006-2009, Ext JS, LLC. * licensing@extjs.com *  * http://extjs.com/license */Ext.form.FileUploadField = Ext.extend(Ext.form.TextField,  {    /**     * @cfg {String} buttonText The button text to display on the upload button (defaults to     * 'Browse...').  Note that if you supply a value for {@link #buttonCfg}, the buttonCfg.text     * value will be used instead if available.     */    buttonText: 'Browse...',    /**     * @cfg {Boolean} buttonOnly True to display the file upload field as a button with no visible     * text field (defaults to false).  If true, all inherited TextField members will still be available.     */    buttonOnly: false,    /**     * @cfg {Number} buttonOffset The number of pixels of space reserved between the button and the text field     * (defaults to 3).  Note that this only applies if {@link #buttonOnly} = false.     */    buttonOffset: 3,    /**     * @cfg {Object} buttonCfg A standard {@link Ext.Button} config object.     */    // private    readOnly: true,        /**     * @hide      * @method autoSize     */    autoSize: Ext.emptyFn,        // private    initComponent: function(){        Ext.form.FileUploadField.superclass.initComponent.call(this);                this.addEvents(            /**             * @event fileselected             * Fires when the underlying file input field's value has changed from the user             * selecting a new file from the system file selection dialog.             * @param {Ext.form.FileUploadField} this             * @param {String} value The file value returned by the underlying file input field             */            'fileselected'        );    },        // private    onRender : function(ct, position){        Ext.form.FileUploadField.superclass.onRender.call(this, ct, position);                this.wrap = this.el.wrap({cls:'x-form-field-wrap x-form-file-wrap'});        this.el.addClass('x-form-file-text');        this.el.dom.removeAttribute('name');                this.fileInput = this.wrap.createChild({            id: this.getFileInputId(),            name: this.name||this.getId(),            cls: 'x-form-file',            tag: 'input',             type: 'file',            size: 1        });                var btnCfg = Ext.applyIf(this.buttonCfg || {}, {            text: this.buttonText        });        this.button = new Ext.Button(Ext.apply(btnCfg, {            renderTo: this.wrap,            cls: 'x-form-file-btn' + (btnCfg.iconCls ? ' x-btn-icon' : '')        }));                if(this.buttonOnly){            this.el.hide();            this.wrap.setWidth(this.button.getEl().getWidth());        }                this.fileInput.on('change', function(){            var v = this.fileInput.dom.value;            this.setValue(v);            this.fireEvent('fileselected', this, v);        }, this);    },        // private    getFileInputId: function(){        return this.id+'-file';    },        // private    onResize : function(w, h){        Ext.form.FileUploadField.superclass.onResize.call(this, w, h);                this.wrap.setWidth(w);                if(!this.buttonOnly){            var w = this.wrap.getWidth() - this.button.getEl().getWidth() - this.buttonOffset;            this.el.setWidth(w);        }    },        // private    preFocus : Ext.emptyFn,        // private    getResizeEl : function(){        return this.wrap;    },    // private    getPositionEl : function(){        return this.wrap;    },    // private    alignErrorIcon : function(){        this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]);    }    });Ext.reg('fileuploadfield', Ext.form.FileUploadField);/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/FileUploader.js *//*--------------------------------------------------*/// vim: ts=4:sw=4:nu:fdc=4:nospell/** * Ext.ux.FileUploader * * @author  Ing. Jozef Sakáloš * @version $Id: Ext.ux.FileUploader.js 302 2008-08-03 20:57:33Z jozo $ * @date    15. March 2008 * * @license Ext.ux.FileUploader is licensed under the terms of * the Open Source LGPL 3.0 license.  Commercial use is permitted to the extent * that the code/component(s) do NOT become part of another Open Source or Commercially * licensed development library or toolkit without explicit permission. *  * License details: http://www.gnu.org/licenses/lgpl.html *//*global Ext *//** * @class Ext.ux.FileUploader * @extends Ext.util.Observable * @constructor */Ext.ux.FileUploader = function(config) {	Ext.apply(this, config);	// call parent	Ext.ux.FileUploader.superclass.constructor.apply(this, arguments);	// add events	// {{{	this.addEvents(		/**		 * @event beforeallstart		 * Fires before an upload (of all files) is started. Return false to cancel the event.		 * @param {Ext.ux.FileUploader} this		 */		 'beforeallstart'		/**		 * @event allfinished		 * Fires after upload (of all files) is finished		 * @param {Ext.ux.FileUploader} this		 */		,'allfinished'		/**		 * @event beforefilestart		 * Fires before the file upload is started. Return false to cancel the event.		 * Fires only when singleUpload = false		 * @param {Ext.ux.FileUploader} this		 * @param {Ext.data.Record} record upload of which is being started		 */		,'beforefilestart'		/**		 * @event filefinished		 * Fires when file finished uploading.		 * Fires only when singleUpload = false		 * @param {Ext.ux.FileUploader} this		 * @param {Ext.data.Record} record upload of which has finished		 */		,'filefinished'		/**		 * @event progress		 * Fires when progress has been updated		 * @param {Ext.ux.FileUploader} this		 * @param {Object} data Progress data object		 * @param {Ext.data.Record} record Only if singleUpload = false		 */		,'progress'	);	// }}}}; // eo constructorExt.extend(Ext.ux.FileUploader, Ext.util.Observable, {		// configuration options	// {{{	/**	 * @cfg {Object} baseParams baseParams are sent to server in each request.	 */	 baseParams:{/*cmd:'upload',dir:'.'*/}	/**	 * @cfg {Boolean} concurrent true to start all requests upon upload start, false to start	 * the next request only if previous one has been completed (or failed). Applicable only if	 * singleUpload = false	 */	,concurrent:true	/**	 * @cfg {Boolean} enableProgress true to enable querying server for progress information	 */	,enableProgress:true	/**	 * @cfg {String} jsonErrorText Text to use for json error	 */	,jsonErrorText:'Cannot decode JSON object'	/**	 * @cfg {Number} Maximum client file size in bytes	 */	,maxFileSize:524288	/**	 * @cfg {String} progressIdName Name to give hidden field for upload progress identificator	 */	,progressIdName:'UPLOAD_IDENTIFIER'	/**	 * @cfg {Number} progressInterval How often (in ms) is progress requested from server	 */	,progressInterval:2000	/**	 * @cfg {String} progressUrl URL to request upload progress from	 */	,progressUrl:'progress.php'	/**	 * @cfg {Object} progressMap Mapping of received progress fields to store progress fields	 */	,progressMap:{		 bytes_total:'bytesTotal'		,bytes_uploaded:'bytesUploaded'		,est_sec:'estSec'		,files_uploaded:'filesUploaded'		,speed_average:'speedAverage'		,speed_last:'speedLast'		,time_last:'timeLast'		,time_start:'timeStart'	}	/**	 * @cfg {Boolean} singleUpload true to upload files in one form, false to upload one by one	 */	,singleUpload:false		/**	 * @cfg {Ext.data.Store} store Mandatory. Store that holds files to upload	 */	/**	 * @cfg {String} unknownErrorText Text to use for unknow error	 */	,unknownErrorText:'Unknown error'	/**	 * @cfg {String} url Mandatory. URL to upload to	 */	// }}}	// private	// {{{	/**	 * uploads in progress count	 * @private	 */	,upCount:0	// }}}	// methods	// {{{	/**	 * creates form to use for upload.	 * @private	 * @return {Ext.Element} form	 */	,createForm:function(record) {		var progressId = parseInt(Math.random() * 1e10, 10);		var form = Ext.getBody().createChild({			 tag:'form'			,action:this.url			,method:'post'			,cls:'x-hidden'			,id:Ext.id()			,cn:[{				 tag:'input'				,type:'hidden'				,name:'APC_UPLOAD_PROGRESS'				,value:progressId			},{				 tag:'input'				,type:'hidden'				,name:this.progressIdName				,value:progressId			},{				 tag:'input'				,type:'hidden'				,name:'MAX_FILE_SIZE'				,value:this.maxFileSize			}]		});		if(record) {			record.set('form', form);			record.set('progressId', progressId);		}		else {			this.progressId = progressId;		}		return form;	} // eo function createForm	// }}}	// {{{	,deleteForm:function(form, record) {		form.remove();		if(record) {			record.set('form', null);		}	} // eo function deleteForm	// }}}	// {{{	/**	 * Fires event(s) on upload finish/error	 * @private	 */	,fireFinishEvents:function(options, response) {		if(true !== this.eventsSuspended && !this.singleUpload) {			this.fireEvent('filefinished', this, response, options && options.record);		}		if(true !== this.eventsSuspended && 0 === this.upCount) {			this.stopProgress();			this.fireEvent('allfinished', this, response);		}	} // eo function fireFinishEvents	// }}}	// {{{	/**	 * Geg the iframe identified by record	 * @private	 * @param {Ext.data.Record} record	 * @return {Ext.Element} iframe or null if not found	 */	,getIframe:function(record) {		var iframe = null;		var form = record.get('form');		if(form && form.dom && form.dom.target) {			iframe = Ext.get(form.dom.target);		}		return iframe;	} // eo function getIframe	// }}}	// {{{	/**	 * returns options for Ajax upload request	 * @private	 * @param {Ext.data.Record} record	 * @param {Object} params params to add	 */	,getOptions:function(record, params) {		var o = {			 url:this.url			,method:'post'			,isUpload:true			,scope:this			,callback:this.uploadCallback			,record:record			,params:this.getParams(record, params)		};		return o;	} // eo function getOptions	// }}}	// {{{	/**	 * get params to use for request	 * @private	 * @return {Object} params	 */	,getParams:function(record, params) {		var p = {path:this.path};		Ext.apply(p, this.baseParams || {}, params || {});		return p;	}	// }}}	// {{{	/**	 * processes success response	 * @private	 * @param {Object} options options the request was called with	 * @param {Object} response request response object	 * @param {Object} o decoded response.responseText	 */	,processSuccess:function(options, response, o) {		var record = false;		// all files uploadded ok		if(this.singleUpload) {			this.store.each(function(r) {				r.set('state', 'done');				r.set('error', '');				r.commit();			});		}		else {			record = options.record;			record.set('state', 'done');			record.set('error', '');			record.commit();		}		this.deleteForm(options.form, record);	} // eo processSuccess	// }}}	// {{{	/**	 * processes failure response	 * @private	 * @param {Object} options options the request was called with	 * @param {Object} response request response object	 * @param {String/Object} error Error text or JSON decoded object. Optional.	 */	,processFailure:function(options, response, error) {		var record = options.record;		var records;		// singleUpload - all files uploaded in one form		if(this.singleUpload) {			// some files may have been successful			records = this.store.queryBy(function(r){				var state = r.get('state');				return 'done' !== state && 'uploading' !== state;			});			records.each(function(record) {				var e = error.errors ? error.errors[record.id] : this.unknownErrorText;				if(e) {					record.set('state', 'failed');					record.set('error', e);					Ext.getBody().appendChild(record.get('input'));				}				else {					record.set('state', 'done');					record.set('error', '');				}				record.commit();			}, this);			this.deleteForm(options.form);		}		// multipleUpload - each file uploaded in it's own form		else {			if(error && 'object' === Ext.type(error)) {				record.set('error', error.errors && error.errors[record.id] ? error.errors[record.id] : this.unknownErrorText);			}			else if(error) {				record.set('error', error);			}			else if(response && response.responseText) {				record.set('error', response.responseText);			}			else {				record.set('error', this.unknownErrorText);			}			record.set('state', 'failed');			record.commit();		}	} // eof processFailure	// }}}	// {{{	/**	 * Delayed task callback	 */	,requestProgress:function() {		var records, p;		var o = {			 url:this.progressUrl			,method:'post'			,params:{}			,scope:this			,callback:function(options, success, response) {				var o;				if(true !== success) {					return;				}				try {					o = Ext.decode(response.responseText);				}				catch(e) {					return;				}				if('object' !== Ext.type(o) || true !== o.success) {					return;				}				if(this.singleUpload) {					this.progress = {};					for(p in o) {						if(this.progressMap[p]) {							this.progress[this.progressMap[p]] = parseInt(o[p], 10);						}					}					if(true !== this.eventsSuspended) {						this.fireEvent('progress', this, this.progress);					}				}				else {					for(p in o) {						if(this.progressMap[p] && options.record) {							options.record.set(this.progressMap[p], parseInt(o[p], 10));						}					}					if(options.record) {						options.record.commit();						if(true !== this.eventsSuspended) {							this.fireEvent('progress', this, options.record.data, options.record);						}					}				}				this.progressTask.delay(this.progressInterval);			}		};		if(this.singleUpload) {			o.params[this.progressIdName] = this.progressId;			o.params.APC_UPLOAD_PROGRESS = this.progressId;			Ext.Ajax.request(o);		}		else {			records = this.store.query('state', 'uploading');			records.each(function(r) {				o.params[this.progressIdName] = r.get('progressId');				o.params.APC_UPLOAD_PROGRESS = o.params[this.progressIdName];				o.record = r;				(function() {					Ext.Ajax.request(o);				}).defer(250);			}, this);		}	} // eo function requestProgress	// }}}	// {{{	/**	 * path setter	 * @private	 */	,setPath:function(path) {		this.path = path;	} // eo setPath	// }}}	// {{{	/**	 * url setter	 * @private	 */	,setUrl:function(url) {		this.url = url;	} // eo setUrl	// }}}	// {{{	/**	 * Starts progress fetching from server	 * @private	 */	,startProgress:function() {		if(!this.progressTask) {			this.progressTask = new Ext.util.DelayedTask(this.requestProgress, this);		}		this.progressTask.delay.defer(this.progressInterval / 2, this.progressTask, [this.progressInterval]);	} // eo function startProgress	// }}}	// {{{	/**	 * Stops progress fetching from server	 * @private	 */	,stopProgress:function() {		if(this.progressTask) {			this.progressTask.cancel();		}	} // eo function stopProgress	// }}}	// {{{	/**	 * Stops all currently running uploads	 */	,stopAll:function() {		var records = this.store.query('state', 'uploading');		records.each(this.stopUpload, this);	} // eo function stopAll	// }}}	// {{{	/**	 * Stops currently running upload	 * @param {Ext.data.Record} record Optional, if not set singleUpload = true is assumed	 * and the global stop is initiated	 */	,stopUpload:function(record) {		// single abord		var iframe = false;		if(record) {			iframe = this.getIframe(record);			this.stopIframe(iframe);			this.upCount--;			this.upCount = 0 > this.upCount ? 0 : this.upCount;			record.set('state', 'stopped');			this.fireFinishEvents({record:record});		}		// all abort		else if(this.form) {			iframe = Ext.fly(this.form.dom.target);			this.stopIframe(iframe);			this.upCount = 0;			this.fireFinishEvents();		}	} // eo function abortUpload	// }}}	// {{{	/**	 * Stops uploading in hidden iframe	 * @private	 * @param {Ext.Element} iframe	 */	,stopIframe:function(iframe) {		if(iframe) {			try {				iframe.dom.contentWindow.stop();				iframe.remove.defer(250, iframe);			}			catch(e){}		}	} // eo function stopIframe	// }}}	// {{{	/**	 * Main public interface function. Preforms the upload	 */	,upload:function() {				var records = this.store.queryBy(function(r){return 'done' !== r.get('state');});		if(!records.getCount()) {			return;		}		// fire beforeallstart event		if(true !== this.eventsSuspended && false === this.fireEvent('beforeallstart', this)) {			return;		}		if(this.singleUpload) {			this.uploadSingle();		}		else {			records.each(this.uploadFile, this);		}				if(true === this.enableProgress) {			this.startProgress();		}	} // eo function upload	// }}}	// {{{	/**	 * called for both success and failure. Does nearly nothing	 * @private	 * but dispatches processing to processSuccess and processFailure functions	 */	,uploadCallback:function(options, success, response) {		var o = {};		this.upCount--;		this.form = false;		// process ajax success		if(true === success) {					// * * * * * * * * * * * * * * * * * *			// Start: Changes Make by Khashayar			// * * * * * * * * * * * * * * * * * *						/*			try {				o = Ext.decode(response.responseText);			}			catch(e) {				this.processFailure(options, response, this.jsonErrorText);				this.fireFinishEvents(options);				return;			}			*/						o.success = (response.responseText) ? false : true;			//var o  = {success: true};						// * * * * * * * * * * * * * * * * * *			// End: Changes Make by Khashayar			// * * * * * * * * * * * * * * * * * *									// process command success			if(true === o.success || Ext.isIE) {				this.processSuccess(options, response, o);			}			// process command failure			else {				this.processFailure(options, response, o);			}		}		// process ajax failure		else {			this.processFailure(options, response);		}		this.fireFinishEvents(options, response);	} // eo function uploadCallback	// }}}	// {{{	/**	 * Uploads one file	 * @param {Ext.data.Record} record	 * @param {Object} params Optional. Additional params to use in request.	 */	,uploadFile:function(record, params) {		// fire beforestart event		if(true !== this.eventsSuspended && false === this.fireEvent('beforefilestart', this, record)) {			return;		}				// create form for upload		var form = this.createForm(record);		// append input to the form		var inp = record.get('input');		var name = this.field_name || inp.id;		inp.set({name:name});		form.appendChild(inp);		// get params for request		var o = this.getOptions(record, params);		o.form = form;		// set state 		record.set('state', 'uploading');		record.set('pctComplete', 0);		// increment active uploads count		this.upCount++;		// request upload		Ext.Ajax.request(o);		// todo:delete after devel		this.getIframe.defer(100, this, [record]);	} // eo function uploadFile	// }}}	// {{{	/**	 * Uploads all files in single request	 */	,uploadSingle:function() {		// get records to upload		var records = this.store.queryBy(function(r){return 'done' !== r.get('state');});		if(!records.getCount()) {			return;		}		// create form and append inputs to it		var form = this.createForm();		records.each(function(record) {			var inp = record.get('input');			inp.set({name:inp.id});			form.appendChild(inp);			record.set('state', 'uploading');		}, this);		// create options for request		var o = this.getOptions();		o.form = form;		// save form for stop		this.form = form;		// increment active uploads counter		this.upCount++;		// request upload		Ext.Ajax.request(o);		} // eo function uploadSingle	// }}}}); // eo extend// register xtypeExt.reg('fileuploader', Ext.ux.FileUploader); // eof/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/UploadPanel.js *//*--------------------------------------------------*//** * Ext.ux.form.UploadPanel * * @author  Ing. Jozef Sakáloš * @version $Id: Ext.ux.UploadPanel.js 310 2008-08-14 17:23:48Z jozo $ * @date    13. March 2008 * * @license Ext.ux.form.UploadPanel is licensed under the terms of * the Open Source LGPL 3.0 license.  Commercial use is permitted to the extent * that the code/component(s) do NOT become part of another Open Source or Commercially * licensed development library or toolkit without explicit permission. *  * License details: http://www.gnu.org/licenses/lgpl.html *//*global Ext *//** * @class Ext.ux.UploadPanel * @extends Ext.Panel */Ext.ux.UploadPanel = Ext.extend(Ext.Panel, {	// configuration options overridable from outside	// {{{	/**	 * @cfg {String} addIconCls icon class for add (file browse) button	 */	 addIconCls:'icon-plus'	/**	 * @cfg {String} addText Text on Add button	 */	,addText:'Add'	/**	 * @cfg {Object} baseParams This object is not used directly by FileTreePanel but it is	 * propagated to lower level objects instead. Included here for convenience.	 */	/**	 * @cfg {String} bodyStyle style to use for panel body	 */	,bodyStyle:'padding:2px'	/**	 * @cfg {String} buttonsAt Where buttons are placed. Valid values are tbar, bbar, body (defaults to 'tbar')	 */	,buttonsAt:'tbar'	/**	 * @cfg {String} clickRemoveText	 */	,clickRemoveText:'Click to remove'	/**	 * @cfg {String} clickStopText	 */	,clickStopText:'Click to stop'	/**	 * @cfg {String} emptyText empty text for dataview	 */	,emptyText:'No files'	/**	 * @cfg {Boolean} enableProgress true to enable querying server for progress information	 * Passed to underlying uploader. Included here for convenience.	 */	,enableProgress:true	/**	 * @cfg {String} errorText	 */	,errorText:'Error'	/**	 * @cfg {String} fileCls class prefix to use for file type classes	 */	,fileCls:'file'	/**	 * @cfg {String} fileQueuedText File upload status text	 */	,fileQueuedText:'File <b>{0}</b> is queued for upload' 	/**	 * @cfg {String} fileDoneText File upload status text	 */	,fileDoneText:'File <b>{0}</b> has been successfully uploaded'	/**	 * @cfg {String} fileFailedText File upload status text	 */	,fileFailedText:'File <b>{0}</b> failed to upload'	/**	 * @cfg {String} fileStoppedText File upload status text	 */	,fileStoppedText:'File <b>{0}</b> stopped by user'	/**	 * @cfg {String} fileUploadingText File upload status text	 */	,fileUploadingText:'Uploading file <b>{0}</b>'	/**	 * @cfg {Number} maxFileSize Maximum upload file size in bytes	 * This config property is propagated down to uploader for convenience	 */	,maxFileSize:524288	/**	 * @cfg {Number} Maximum file name length for short file names	 */	,maxLength:18	/**	 * @cfg {String} removeAllIconCls iconClass to use for Remove All button (defaults to 'icon-cross'	 */	,removeAllIconCls:'icon-cross'	/**	 * @cfg {String} removeAllText text to use for Remove All button tooltip	 */	,removeAllText:'Remove All'	/**	 * @cfg {String} removeIconCls icon class to use for remove file icon	 */	,removeIconCls:'icon-minus'	/**	 * @cfg {String} removeText Remove text	 */	,removeText:'Remove'	/**	 * @cfg {String} selectedClass class for selected item of DataView	 */	,selectedClass:'ux-up-item-selected'	/**	 * @cfg {Boolean} singleUpload true to upload files in one form, false to upload one by one	 * This config property is propagated down to uploader for convenience	 */	,singleUpload:false	/**	 * @cfg {String} stopAllText	 */	,stopAllText:'Stop All'	/** 	 * @cfg {String} stopIconCls icon class to use for stop	 */	,stopIconCls:'icon-stop'	/**	 * @cfg {String/Ext.XTemplate} tpl Template for DataView.	 */	/**	 * @cfg {String} uploadText Upload text	 */	,uploadText:'Upload'	/**	 * @cfg {String} uploadIconCls icon class to use for upload button	 */	,uploadIconCls:'icon-upload'	/**	 * @cfg {String} workingIconCls iconClass to use for busy indicator	 */	,workingIconCls:'icon-working'	// }}}	// overrides	// {{{	,initComponent:function() {		// {{{		// create buttons		// add (file browse button) configuration		var addCfg = {			 xtype:'browsebutton'			,text:this.addText 			,iconCls:this.addIconCls			,scope:this			,handler:this.onAddFile			,ctCls:'addfile'			,style: 'margin-bottom:5px;'		};		// upload button configuration		var upCfg = {			 xtype:'button'			,iconCls:this.uploadIconCls			,text:this.uploadText			,scope:this			,handler:this.onUpload			,disabled:true		};		// remove all button configuration		var removeAllCfg = {			 xtype:'button'			,iconCls:this.removeAllIconCls			,tooltip:this.removeAllText			,scope:this			,handler:this.onRemoveAllClick			,disabled:true			,hidden:true		};		// todo: either to cancel buttons in body or implement it		if('body' !== this.buttonsAt) {			this[this.buttonsAt] = [addCfg, upCfg, '->', removeAllCfg];		}				// }}}		// {{{		// create store		// fields for record		var fields = [			 {name:'id', type:'text', system:true}			,{name:'shortName', type:'text', system:true}			,{name:'fileName', type:'text', system:true}			,{name:'filePath', type:'text', system:true}			,{name:'fileCls', type:'text', system:true}			,{name:'input', system:true}			,{name:'form', system:true}			,{name:'state', type:'text', system:true}			,{name:'error', type:'text', system:true}			,{name:'progressId', type:'int', system:true}			,{name:'bytesTotal', type:'int', system:true}			,{name:'bytesUploaded', type:'int', system:true}			,{name:'estSec', type:'int', system:true}			,{name:'filesUploaded', type:'int', system:true}			,{name:'speedAverage', type:'int', system:true}			,{name:'speedLast', type:'int', system:true}			,{name:'timeLast', type:'int', system:true}			,{name:'timeStart', type:'int', system:true}			,{name:'pctComplete', type:'int', system:true}		];		// add custom fields if passed		if(Ext.isArray(this.customFields)) {			fields.push(this.customFields);		}		// create store		this.store = new Ext.data.SimpleStore({			 id:0			,fields:fields			,data:[]			,listeners:{				add: function(st){					var txt = (st.getCount() > 0) ? 'Add more files' : 'Choose files';					this.addBtn.setText(txt);				}				,remove: function(st){					var txt = (st.getCount() > 0) ? 'Add more files' : 'Choose files';					this.addBtn.setText(txt);				}				,scope: this		}		});		// }}}		// {{{		// create view		Ext.apply(this, {			items:[{html:'<div style="font-weight:bold;padding:5px;">Choose files. Then click "Upload Files"</div>'},addCfg,removeAllCfg,{				 xtype:'dataview'				,itemSelector:'div.ux-up-item'				,store:this.store				,selectedClass:this.selectedClass				,singleSelect:true				,emptyText:this.emptyText				,tpl: this.tpl || new Ext.XTemplate(					  '<tpl for=".">'					+ '<div class="ux-up-item">'//					+ '<div class="ux-up-indicator">&#160;</div>'					+ '<div class="ux-up-icon-file {fileCls}">&#160;</div>'					+ '<div class="ux-up-text x-unselectable" qtip="{fileName}">{shortName}</div>'					+ '<div id="remove-{[values.input.id]}" class="ux-up-icon-state ux-up-icon-{state}"'					+ 'qtip="{[this.scope.getQtip(values)]}">&#160;</div>'					+ '</div>'					+ '</tpl>'					, {scope:this}				)				,listeners:{click:{scope:this, fn:this.onViewClick}}			}]		});		// }}}		// call parent		Ext.ux.UploadPanel.superclass.initComponent.apply(this, arguments);		// save useful references		this.view = this.items.itemAt(3);		// {{{		// add events		this.addEvents(			/**			 * Fires before the file is added to store. Return false to cancel the add			 * @event beforefileadd			 * @param {Ext.ux.UploadPanel} this			 * @param {Ext.Element} input (type=file) being added			 */			'beforefileadd'			/**			 * Fires after the file is added to the store			 * @event fileadd			 * @param {Ext.ux.UploadPanel} this			 * @param {Ext.data.Store} store			 * @param {Ext.data.Record} Record (containing the input) that has been added to the store			 */			,'fileadd'			/**			 * Fires before the file is removed from the store. Return false to cancel the remove			 * @event beforefileremove			 * @param {Ext.ux.UploadPanel} this			 * @param {Ext.data.Store} store			 * @param {Ext.data.Record} Record (containing the input) that is being removed from the store			 */			,'beforefileremove'			/**			 * Fires after the record (file) has been removed from the store			 * @event fileremove			 * @param {Ext.ux.UploadPanel} this			 * @param {Ext.data.Store} store			 */			,'fileremove'			/**			 * Fires before all files are removed from the store (queue). Return false to cancel the clear.			 * Events for individual files being removed are suspended while clearing the queue.			 * @event beforequeueclear			 * @param {Ext.ux.UploadPanel} this			 * @param {Ext.data.Store} store			 */			,'beforequeueclear'			/**			 * Fires after the store (queue) has been cleared			 * Events for individual files being removed are suspended while clearing the queue.			 * @event queueclear			 * @param {Ext.ux.UploadPanel} this			 * @param {Ext.data.Store} store			 */			,'queueclear'			/**			 * Fires after the upload button is clicked but before any upload is started			 * Return false to cancel the event			 * @param {Ext.ux.UploadPanel} this			 */			,'beforeupload'		);		// }}}		// {{{		// relay view events		this.relayEvents(this.view, [			 'beforeclick'			,'beforeselect'			,'click'			,'containerclick'			,'contextmenu'			,'dblclick'			,'selectionchange'		]);		// }}}				// create uploader		var config = {			 store:this.store			,singleUpload:this.singleUpload			,maxFileSize:this.maxFileSize			,enableProgress:this.enableProgress			,url:this.url			,path:this.path			,field_name: this.field_name		};				if(this.baseParams) {			config.baseParams = this.baseParams;		}		this.uploader = new Ext.ux.FileUploader(config);		// relay uploader events		this.relayEvents(this.uploader, [			 'beforeallstart'			,'allfinished'			,'filefinished'			,'beforefilestart'			,'progress'		]);		// install event handlers		this.on({			 beforeallstart:{scope:this, fn:function() {			 	this.uploading = true;				this.updateButtons();			}}			,allfinished:{scope:this, fn:function() {				this.uploading = false;				this.updateButtons();			}}			,progress:{fn:this.onProgress.createDelegate(this)}		});	} // eo function initComponent	// }}}	// {{{	/**	 * onRender override, saves references to buttons	 * @private	 */	,onRender:function() {		// call parent		Ext.ux.UploadPanel.superclass.onRender.apply(this, arguments);		// save useful references		/*		var tb = 'tbar' === this.buttonsAt ? this.getTopToolbar() : this.getBottomToolbar();		this.addBtn = Ext.getCmp(tb.items.first().id);		this.uploadBtn = Ext.getCmp(tb.items.itemAt(1).id);		this.removeAllBtn = Ext.getCmp(tb.items.last().id);		*/	   this.addBtn = this.items.itemAt(1);	   this.removeAllBtn = this.items.itemAt(2);	} // eo function onRender	// }}}	// added methods	// {{{	/**	 * called by XTemplate to get qtip depending on state	 * @private	 * @param {Object} values XTemplate values	 */	,getQtip:function(values) {		var qtip = '';		switch(values.state) {			case 'queued':				qtip = String.format(this.fileQueuedText, values.fileName);				qtip += '<br>' + this.clickRemoveText;			break;			case 'uploading':				qtip = String.format(this.fileUploadingText, values.fileName);				qtip += '<br>' + values.pctComplete + '% done';				qtip += '<br>' + this.clickStopText;			break;			case 'done':				qtip = String.format(this.fileDoneText, values.fileName);				qtip += '<br>' + this.clickRemoveText;			break;			case 'failed':				qtip = String.format(this.fileFailedText, values.fileName);				qtip += '<br>' + this.errorText + ':' + values.error;				qtip += '<br>' + this.clickRemoveText;			break;			case 'stopped':				qtip = String.format(this.fileStoppedText, values.fileName);				qtip += '<br>' + this.clickRemoveText;			break;		}		return qtip;	} // eo function getQtip	// }}}	// {{{	/**	 * get file name	 * @private	 * @param {Ext.Element} inp Input element containing the full file path	 * @return {String}	 */	,getFileName:function(inp) {		return inp.getValue().split(/[\/\\]/).pop();	} // eo function getFileName	// }}}	// {{{	/**	 * get file path (excluding the file name)	 * @private	 * @param {Ext.Element} inp Input element containing the full file path	 * @return {String}	 */	,getFilePath:function(inp) {		return inp.getValue().replace(/[^\/\\]+$/,'');	} // eo function getFilePath	// }}}	// {{{	/**	 * returns file class based on name extension	 * @private	 * @param {String} name File name to get class of	 * @return {String} class to use for file type icon	 */	,getFileCls: function(name) {		var atmp = name.split('.');		if(1 === atmp.length) {			return this.fileCls;		}		else {			return this.fileCls + '-' + atmp.pop().toLowerCase();		}	}	// }}}	// {{{	/**	 * called when file is added - adds file to store	 * @private	 * @param {Ext.ux.BrowseButton}	 */	,onAddFile:function(bb) {		if(true !== this.eventsSuspended && false === this.fireEvent('beforefileadd', this, bb.getInputFile())) {			return;		}		var inp = bb.detachInputFile();		inp.addClass('x-hidden');		var fileName = this.getFileName(inp);		// create new record and add it to store		var rec = new this.store.recordType({			 input:inp			,fileName:fileName			,filePath:this.getFilePath(inp)			,shortName: Ext.util.Format.ellipsis(fileName, this.maxLength)			,fileCls:this.getFileCls(fileName)			,state:'queued'		}, inp.id);		rec.commit();		this.store.add(rec);		this.syncShadow();		this.uploadBtn.enable();		this.removeAllBtn.enable();		if(true !== this.eventsSuspended) {			this.fireEvent('fileadd', this, this.store, rec);		}		this.doLayout();	} // eo onAddFile	// }}}	// {{{	/**	 * destroys child components	 * @private	 */	,onDestroy:function() {		// destroy uploader		if(this.uploader) {			this.uploader.stopAll();			this.uploader.purgeListeners();			this.uploader = null;		}		// destroy view		if(this.view) {			this.view.purgeListeners();			this.view.destroy();			this.view = null;		}		// destroy store		if(this.store) {			this.store.purgeListeners();			this.store.destroy();			this.store = null;		}	} // eo function onDestroy	// }}}	// {{{	/**	 * progress event handler	 * @private	 * @param {Ext.ux.FileUploader} uploader	 * @param {Object} data progress data	 * @param {Ext.data.Record} record	 */	,onProgress:function(uploader, data, record) {		var bytesTotal, bytesUploaded, pctComplete, state, idx, item, width, pgWidth;		if(record) {			state = record.get('state');			bytesTotal = record.get('bytesTotal') || 1;			bytesUploaded = record.get('bytesUploaded') || 0;			if('uploading' === state) {				pctComplete = Math.round(1000 * bytesUploaded/bytesTotal) / 10;			}			else if('done' === state) {				pctComplete = 100;			}			else {				pctComplete = 0;			}			record.set('pctComplete', pctComplete);			idx = this.store.indexOf(record);			item = Ext.get(this.view.getNode(idx));			if(item) {				width = item.getWidth();				item.applyStyles({'background-position':width * pctComplete / 100 + 'px'});			}		}	} // eo function onProgress	// }}}	// {{{	/**	 * called when file remove icon is clicked - performs the remove	 * @private	 * @param {Ext.data.Record}	 */	,onRemoveFile:function(record) {		if(true !== this.eventsSuspended && false === this.fireEvent('beforefileremove', this, this.store, record)) {			return;		}				// remove DOM elements		var inp = record.get('input');		var wrap = inp.up('em');		inp.remove();		if(wrap) {			//wrap.remove();		}		// remove record from store		this.store.remove(record);		var count = this.store.getCount();		this.uploadBtn.setDisabled(!count);		this.removeAllBtn.setDisabled(!count);		if(true !== this.eventsSuspended) {			this.fireEvent('fileremove', this, this.store);			this.syncShadow();		}	} // eo function onRemoveFile	// }}}	// {{{	/**	 * Remove All/Stop All button click handler	 * @private	 */	,onRemoveAllClick:function(btn) {		if(true === this.uploading) {			this.stopAll();		}		else {			this.removeAll();		}	} // eo function onRemoveAllClick	,stopAll:function() {		this.uploader.stopAll();	} // eo function stopAll	// }}}	// {{{	/**	 * DataView click handler	 * @private	 */	,onViewClick:function(view, index, node, e) {		var t = e.getTarget('div:any(.ux-up-icon-queued|.ux-up-icon-failed|.ux-up-icon-done|.ux-up-icon-stopped)');		if(t) {			this.onRemoveFile(this.store.getAt(index));		}		t = e.getTarget('div.ux-up-icon-uploading');		if(t) {			this.uploader.stopUpload(this.store.getAt(index));		}	} // eo function onViewClick	// }}}	// {{{	/**	 * tells uploader to upload	 * @private	 */	,onUpload:function() {		if(true !== this.eventsSuspended && false === this.fireEvent('beforeupload', this)) {			return false;		}		this.uploader.upload();	} // eo function onUpload	// }}}	// {{{	/**	 * url setter	 */	,setUrl:function(url) {		this.url = url;		this.uploader.setUrl(url);	} // eo function setUrl	// }}}	// {{{	/**	 * path setter	 */	,setPath:function(path) {		this.uploader.setPath(path);	} // eo function setPath	// }}}	// {{{	/**	 * Updates buttons states depending on uploading state	 * @private	 */	,updateButtons:function() {		if(true === this.uploading) {			this.addBtn.disable();			this.uploadBtn.disable();			this.removeAllBtn.setIconClass(this.stopIconCls);			this.removeAllBtn.getEl().child(this.removeAllBtn.buttonSelector).dom[this.removeAllBtn.tooltipType] = this.stopAllText;		}		else {			this.addBtn.enable();			this.uploadBtn.enable();			this.removeAllBtn.setIconClass(this.removeAllIconCls);			this.removeAllBtn.getEl().child(this.removeAllBtn.buttonSelector).dom[this.removeAllBtn.tooltipType] = this.removeAllText;		}	} // eo function updateButtons	// }}}	// {{{	/**	 * Removes all files from store and destroys file inputs	 */	,removeAll:function() {		var suspendState = this.eventsSuspended;		if(false !== this.eventsSuspended && false === this.fireEvent('beforequeueclear', this, this.store)) {			return false;		}		this.suspendEvents();		this.store.each(this.onRemoveFile, this);		this.eventsSuspended = suspendState;		if(true !== this.eventsSuspended) {			this.fireEvent('queueclear', this, this.store);		}		this.syncShadow();	} // eo function removeAll	// }}}	// {{{	/**	 * synchronize context menu shadow if we're in contextmenu	 * @private	 */	,syncShadow:function() {		if(this.contextmenu && this.contextmenu.shadow) {			this.contextmenu.getEl().shadow.show(this.contextmenu.getEl());		}	} // eo function syncShadow	// }}}}); // eo extend// register xtypeExt.reg('uploadpanel', Ext.ux.UploadPanel);/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/miframe-min.js *//*--------------------------------------------------*/Ext.ux.ManagedIFrame=function(){var C=Array.prototype.slice.call(arguments,0),D=Ext.get(C[0]),B=C[0];if(D&&D.dom&&D.dom.tagName=="IFRAME"){B=C[1]||{};}else{B=C[0]||C[1]||{};D=B.autoCreate?Ext.get(Ext.DomHelper.append(B.autoCreate.parent||document.body,Ext.apply({tag:"iframe",src:(Ext.isIE&&Ext.isSecure)?Ext.SSL_SECURE_URL:""},B.autoCreate))):null;}if(!D||D.dom.tagName!="IFRAME"){return D;}!!D.dom.name.length||(D.dom.name=D.dom.id);this.addEvents({"domready":true,"documentloaded":true,"exception":true,"message":true});if(B.listeners){this.listeners=B.listeners;Ext.ux.ManagedIFrame.superclass.constructor.call(this);}Ext.apply(D,this);D.addClass("x-managed-iframe");if(B.style){D.applyStyles(B.style);}D._maskEl=D.parent(".x-managed-iframe-mask")||D.parent().addClass("x-managed-iframe-mask");Ext.apply(D,{disableMessaging:B.disableMessaging===true,loadMask:Ext.apply({msg:"Loading..",msgCls:"x-mask-loading",maskEl:D._maskEl,hideOnReady:true,disabled:!B.loadMask},B.loadMask),_eventName:Ext.isIE?"onreadystatechange":"onload",_windowContext:null,eventsFollowFrameLinks:typeof B.eventsFollowFrameLinks=="undefined"?true:B.eventsFollowFrameLinks});D.dom[D._eventName]=D.loadHandler.createDelegate(D);if(document.addEventListener){Ext.EventManager.on(window,"DOMFrameContentLoaded",D.dom[D._eventName]);}var A=D.updateManager=new Ext.UpdateManager(D,true);A.showLoadIndicator=B.showLoadIndicator||false;if(B.src){D.setSrc(B.src);}else{var E=B.html||B.content||false;if(E){D.update.defer(10,D,[E]);}}return Ext.ux.ManagedIFrame.Manager.register(D);};Ext.extend(Ext.ux.ManagedIFrame,Ext.util.Observable,{src:null,setSrc:function(A,C,E){var B=Ext.isIE&&Ext.isSecure?Ext.SSL_SECURE_URL:"";var D=A||this.src||B;if(Ext.isOpera){this.dom.src=B;}this._windowContext=null;this._hooked=this._domReady=this._domFired=false;this._callBack=E||false;this.showMask();(function(){var G=typeof D=="function"?D()||"":D;try{this._frameAction=true;this.dom.src=G;this.frameInit=true;this.checkDOM();}catch(F){this.fireEvent("exception",this,F);}}).defer(10,this);if(C!==true){this.src=D;}return this;},reset:function(A,B){this.setSrc(A||(Ext.isIE&&Ext.isSecure?Ext.SSL_SECURE_URL:""),true,B);},scriptRE:/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/gi,update:function(B,A,D){A=A||this.getUpdateManager().loadScripts||false;B=Ext.DomHelper.markup(B||"");B=A===true?B:B.replace(this.scriptRE,"");var C;if(C=this.getDocument()){this._frameAction=!!B.length;this._windowContext=this.src=null;this._callBack=D||false;this._hooked=this._domReady=this._domFired=false;this.showMask();C.open();C.write(B);C.close();this.frameInit=true;if(this._frameAction){this.checkDOM();}else{this.hideMask(true);if(this._callBack){this._callBack();}}}else{this.hideMask(true);if(this._callBack){this._callBack();}}return this;},disableMessaging:true,_XFrameMessaging:function(){var A={"$":[]};var B=function(D,C){return D===null||D===undefined||(!C?D==="":false);};window.sendMessage=function(K,L,J){var F;if(F=arguments.callee.manager){if(K._fromHost){var I,M;var C=K.tag||L||null;var D=!B(C)?A[C.toLowerCase()]||[]:A["$"];for(var G=0,E=D.length;G<E;G++){if(I=D[G]){M=I.apply(I.__scope,arguments)===false?false:M;if(I.__single){D[G]=null;}if(M===false){break;}}}return M;}else{K={type:B(L)?"message":"message:"+L.toLowerCase().replace(/^\s+|\s+$/g,""),data:K,domain:J||document.domain,uri:document.documentURI,source:window,tag:B(L)?null:L.toLowerCase()};try{return F.disableMessaging!==true?F.fireEvent.call(F,K.type,F,K):null;}catch(H){}return null;}}};window.onhostmessage=function(F,E,G,C){if(typeof F=="function"){if(!B(F.__index)){throw"onhostmessage: duplicate handler definition"+(C?" for tag:"+C:"");}var D=B(C)?"$":C.toLowerCase();A[D]||(A[D]=[]);Ext.apply(F,{__tag:D,__single:G||false,__scope:E||window,__index:A[D].length});A[D].push(F);}else{throw"onhostmessage: function required";}};window.unhostmessage=function(D){if(typeof D=="function"&&typeof D.__index!="undefined"){var C=D.__tag||"$";A[C][D.__index]=null;}};},_renderHook:function(){this._windowContext=null;this._hooked=false;try{if(this.writeScript('(function(){(window.hostMIF = parent.Ext.get("'+this.dom.id+'"))._windowContext='+(Ext.isIE?"window":"{eval:function(s){return eval(s);}}")+";})();")){if(this.disableMessaging!==true){this.loadFunction({name:"XMessage",fn:this._XFrameMessaging},false,true);var B;if(B=this.getWindow().sendMessage){B.manager=this;}}}return this.domWritable();}catch(A){}return false;},sendMessage:function(C,A,B){var D;if(this.disableMessaging!==true&&(D=this.getWindow())){A||(A=C.tag||"");A=A.toLowerCase();C=Ext.applyIf(C.data?C:{data:C},{type:Ext.isEmpty(A)?"message":"message:"+A,domain:B||document.domain,uri:document.documentURI,source:window,tag:A||null,_fromHost:this});return D.sendMessage?D.sendMessage.call(null,C,A,B):null;}return null;},_windowContext:null,getDocument:function(){return this.getWindow()?this.getWindow().document:null;},getDocumentURI:function(){var A;try{A=this.src?this.getDocument().location.href:null;}catch(B){}return A||this.src;},getWindow:function(){var A=this.dom;return A?A.contentWindow||window.frames[A.name]:null;},print:function(){try{var B=this.getWindow();if(Ext.isIE){B.focus();}B.print();}catch(A){throw"print exception: "+(A.description||A.message||A);}},destroy:function(){this.removeAllListeners();if(this.dom){if(document.addEventListener){Ext.EventManager.un(window,"DOMFrameContentLoaded",this.dom[this._eventName]);}this.dom[this._eventName]=null;this._windowContext=null;if(Ext.isIE&&this.dom.src){this.dom.src="javascript:false";}this._maskEl=null;Ext.removeNode(this.dom);}Ext.apply(this.loadMask,{masker:null,maskEl:null});Ext.ux.ManagedIFrame.Manager.deRegister(this);},domWritable:function(){return !!this._windowContext;},execScript:function(block,useDOM){try{if(this.domWritable()){if(useDOM){this.writeScript(block);}else{return this._windowContext.eval(block);}}else{throw"execScript:non-secure context";}}catch(ex){this.fireEvent("exception",this,ex);return false;}return true;},writeScript:function(G,B){B=Ext.apply({},B||{},{type:"text/javascript",text:G});try{var D,A,F=this.getDocument();if(F&&F.getElementsByTagName){if(!(D=F.getElementsByTagName("head")[0])){D=F.createElement("head");F.getElementsByTagName("html")[0].appendChild(D);}if(D&&(A=F.createElement("script"))){for(var E in B){if(B.hasOwnProperty(E)&&E in A){A[E]=B[E];}}return !!D.appendChild(A);}}}catch(C){this.fireEvent("exception",this,C);}return false;},loadFunction:function(D,B,C){var A=D.name||D;var D=D.fn||window[D];this.execScript(A+"="+D,B);if(C){this.execScript(A+"()");}},showMask:function(D,C,B){var A;if((A=this.loadMask)&&(!A.disabled||B)){if(A._vis){return ;}A.masker||(A.masker=Ext.get(A.maskEl||this.dom.parentNode||this.wrap({tag:"div",style:{position:"relative"}})));A._vis=true;A.masker.mask.defer(A.delay||5,A.masker,[D||A.msg,C||A.msgCls]);}},hideMask:function(B){var A;if((A=this.loadMask)&&!A.disabled&&A.masker){if(!B&&(A.hideOnReady!==true&&this._domReady)){return ;}A._vis=false;A.masker.unmask.defer(A.delay||5,A.masker);}},loadHandler:function(B){if(!this.frameInit||(!this._frameAction&&!this.eventsFollowFrameLinks)){return ;}var A=(B&&typeof B.type!=="undefined"?B.type:this.dom.readyState);switch(A){case"loading":case"interactive":break;case"DOMFrameContentLoaded":if(this._domFired||(B&&B.target!==this.dom)){return ;}case"domready":if(this._domFired){return ;}if(this._domFired=this._hooked=this._renderHook()){this._frameAction=(this.fireEvent("domready",this)===false?false:this._frameAction);}case"domfail":this._domReady=true;this.hideMask();break;case"load":case"complete":if(!this._domFired){this.loadHandler({type:"domready"});}this.hideMask(true);if(this._frameAction||this.eventsFollowFrameLinks){this.fireEvent.defer(50,this,["documentloaded",this]);}this._frameAction=false;if(this.eventsFollowFrameLinks){this._domFired=this._domReady=false;}if(this._callBack){this._callBack(this);}break;default:}},checkDOM:function(D){if(Ext.isOpera){return ;}var F=0,D=D||this.getWindow(),C=this,B=false,A=100;var E=function(){try{B=false;var I=D.document,G;if(!C._domReady){B=(I&&I.getElementsByTagName);B=B&&(G=I.getElementsByTagName("body")[0])&&!!G.innerHTML.length;}}catch(H){F=A;}if(!C._frameAction||C._domReady){return ;}if(F++<A&&!B){setTimeout(arguments.callee,10);return ;}C.loadHandler({type:B?"domready":"domfail"});};setTimeout(E,50);}});Ext.ux.ManagedIFrame.Manager=function(){var B={},A={};return{shimCls:"x-frame-shim",register:function(C){C.manager=this;return B[C.id]=A[C.dom.name||C.id]=C;},deRegister:function(C){delete B[C.id];delete A[C.dom.name||C.id];},hideDragMask:function(){if(!this.shimApplied){return ;}Ext.select("."+this.shimCls,true).removeClass(this.shimCls+"-on");this.shimApplied=false;},showDragMask:function(){if(!this.shimApplied){this.shimApplied=true;Ext.select("."+this.shimCls,true).addClass(this.shimCls+"-on");}},getFrameById:function(C){return B[C]||null;},getFrameByName:function(C){return A[C]||null;}};}();Ext.ux.ManagedIframePanel=Ext.extend(Ext.Panel,{defaultSrc:null,bodyStyle:{height:"100%",width:"100%",position:"relative"},frameStyle:{overflow:"auto"},frameConfig:null,hideMode:!Ext.isIE?"nosize":"display",shimCls:Ext.ux.ManagedIFrame.Manager.shimCls,shimUrl:null,loadMask:false,animCollapse:Ext.isIE,autoScroll:false,closable:true,ctype:"Ext.ux.ManagedIframePanel",showLoadIndicator:false,unsupportedText:"Inline frames are NOT enabled/supported by your browser.",initComponent:function(){var A=this.unsupportedText?{html:this.unsupportedText}:false;this.bodyCfg||(this.bodyCfg={tag:"div",cls:"x-panel-body",children:[{cls:"x-managed-iframe-mask",children:[Ext.apply(Ext.apply({tag:"iframe",frameborder:0,cls:"x-managed-iframe",style:this.frameStyle||null},this.frameConfig),A,Ext.isIE&&Ext.isSecure?{src:Ext.SSL_SECURE_URL}:false),{tag:"img",src:this.shimUrl||Ext.BLANK_IMAGE_URL,cls:this.shimCls}]}]});this.autoScroll=false;this.items=null;if(this.stateful!==false){this.stateEvents||(this.stateEvents=["documentloaded"]);}Ext.ux.ManagedIframePanel.superclass.initComponent.call(this);this.monitorResize||(this.monitorResize=this.fitToParent);this.addEvents({documentloaded:true,domready:true,message:true,exception:true});this.addListener=this.on;},doLayout:function(){if(this.fitToParent&&!this.ownerCt){var B=this.getPosition(),A=(Ext.get(this.fitToParent)||this.getEl().parent()).getViewSize();this.setSize(A.width-B[0],A.height-B[1]);}Ext.ux.ManagedIframePanel.superclass.doLayout.apply(this,arguments);},beforeDestroy:function(){if(this.rendered){if(this.tools){for(var A in this.tools){Ext.destroy(this.tools[A]);}}if(this.header&&this.headerAsText){var B;if(B=this.header.child("span")){B.remove();}this.header.update("");}Ext.each(["iframe","header","topToolbar","bottomToolbar","footer","loadMask","body","bwrap"],function(C){if(this[C]){if(typeof this[C].destroy=="function"){this[C].destroy();}else{Ext.destroy(this[C]);}this[C]=null;delete this[C];}},this);}Ext.ux.ManagedIframePanel.superclass.beforeDestroy.call(this);},onDestroy:function(){Ext.Panel.superclass.onDestroy.call(this);},onRender:function(B,A){Ext.ux.ManagedIframePanel.superclass.onRender.call(this,B,A);if(this.iframe=this.body.child("iframe.x-managed-iframe")){var D=Ext.Element;var E=D[this.hideMode.toUpperCase()]||"x-hide-nosize";Ext.each([this[this.collapseEl],this.floating?null:this.getActionEl(),this.iframe],function(F){if(F){F.setVisibilityMode(E);}},this);if(this.loadMask){this.loadMask=Ext.apply({disabled:false,maskEl:this.body,hideOnReady:true},this.loadMask);}if(this.iframe=new Ext.ux.ManagedIFrame(this.iframe,{loadMask:this.loadMask,showLoadIndicator:this.showLoadIndicator,disableMessaging:this.disableMessaging,style:this.frameStyle})){this.loadMask=this.iframe.loadMask;this.iframe.ownerCt=this;this.relayEvents(this.iframe,["documentloaded","domready","exception","message"].concat(this._msgTagHandlers||[]));delete this._msgTagHandlers;}this.getUpdater().showLoadIndicator=this.showLoadIndicator||false;var C=this.ownerCt;while(C){C.on("afterlayout",function(F,I){var G=Ext.ux.ManagedIFrame.Manager,H=false;Ext.each(["north","south","east","west"],function(K){var J;if((J=I[K])&&J.splitEl){H=true;if(!J.split._splitTrapped){J.split.on("beforeresize",G.showDragMask,G);J.split._splitTrapped=true;}}},this);if(H&&!this._splitTrapped){this.on("resize",G.hideDragMask,G);this._splitTrapped=true;}},this,{single:true});C=C.ownerCt;}}this.shim=Ext.get(this.body.child(".x-frame-shim"));},toggleShim:function(){if(this.shim&&this.shimCls){this.shim.toggleClass(this.shimCls);}},afterRender:function(A){var B=this.html;delete this.html;Ext.ux.ManagedIframePanel.superclass.afterRender.call(this);if(this.iframe){if(this.defaultSrc){this.setSrc();}else{if(B){this.iframe.update(typeof B=="object"?Ext.DomHelper.markup(B):B);}}}},sendMessage:function(){if(this.iframe){this.iframe.sendMessage.apply(this.iframe,arguments);}},on:function(B){var D=/^message\:/i,C=null;if(typeof B=="object"){for(var A in B){if(!this.filterOptRe.test(A)&&D.test(A)){C||(C=[]);C.push(A.toLowerCase());}}}else{if(D.test(B)){C=[B.toLowerCase()];}}if(this.getFrame()&&C){this.relayEvents(this.iframe,C);}else{this._msgTagHandlers||(this._msgTagHandlers=[]);if(C){this._msgTagHandlers=this._msgTagHandlers.concat(C);}}Ext.ux.ManagedIframePanel.superclass.on.apply(this,arguments);},setSrc:function(A,B,D){A=A||this.defaultSrc||false;if(!A){return this;}if(A.url){D=A.callback||false;B=A.discardUrl||false;A=A.url||false;}var C=A||(Ext.isIE&&Ext.isSecure?Ext.SSL_SECURE_URL:"");if(this.rendered&&this.iframe){this.iframe.setSrc(C,B,D);}return this;},getState:function(){var A=this.iframe?this.iframe.getDocumentURI()||null:null;return Ext.apply(Ext.ux.ManagedIframePanel.superclass.getState.call(this)||{},A?{defaultSrc:typeof A=="function"?A():A}:null);},getUpdater:function(){return this.rendered?(this.iframe||this.body).getUpdater():null;},getFrame:function(){return this.rendered?this.iframe:null;},getFrameWindow:function(){return this.rendered&&this.iframe?this.iframe.getWindow():null;},getFrameDocument:function(){return this.rendered&&this.iframe?this.iframe.getDocument():null;},load:function(B){var A;if(A=this.getUpdater()){if(B&&B.renderer){A.setRenderer(B.renderer);delete B.renderer;}A.update.apply(A,arguments);}return this;},doAutoLoad:function(){this.load(typeof this.autoLoad=="object"?this.autoLoad:{url:this.autoLoad});}});Ext.reg("iframepanel",Ext.ux.ManagedIframePanel);Ext.ux.ManagedIframePortlet=Ext.extend(Ext.ux.ManagedIframePanel,{anchor:"100%",frame:true,collapseEl:"bwrap",collapsible:true,draggable:true,cls:"x-portlet"});Ext.reg("iframeportlet",Ext.ux.ManagedIframePortlet);Ext.apply(Ext.Element.prototype,{setVisible:function(D,A){if(!A||!Ext.lib.Anim){if(this.visibilityMode==Ext.Element.DISPLAY){this.setDisplayed(D);}else{if(this.visibilityMode==Ext.Element.VISIBILITY){this.fixDisplay();this.dom.style.visibility=D?"visible":"hidden";}else{this[D?"removeClass":"addClass"](String(this.visibilityMode));}}}else{var C=this.dom;var B=this.visibilityMode;if(D){this.setOpacity(0.01);this.setVisible(true);}this.anim({opacity:{to:(D?1:0)}},this.preanim(arguments,1),null,0.35,"easeIn",function(){if(!D){if(B==Ext.Element.DISPLAY){C.style.display="none";}else{if(B==Ext.Element.VISIBILITY){C.style.visibility="hidden";}else{Ext.get(C).addClass(String(B));}}Ext.get(C).setOpacity(1);}});}return this;},isVisible:function(A){var B=!(this.getStyle("visibility")=="hidden"||this.getStyle("display")=="none"||this.hasClass(this.visibilityMode));if(A!==true||!B){return B;}var C=this.dom.parentNode;while(C&&C.tagName.toLowerCase()!="body"){if(!Ext.fly(C,"_isVisible").isVisible()){return false;}C=C.parentNode;}return true;}});Ext.onReady(function(){var A=Ext.util.CSS,B=[];A.getRule(".x-managed-iframe")||(B.push(".x-managed-iframe {height:100%;width:100%;overflow:auto;}"));A.getRule(".x-managed-iframe-mask")||(B.push(".x-managed-iframe-mask{width:100%;height:100%;position:relative;}"));if(!A.getRule(".x-frame-shim")){B.push(".x-frame-shim {z-index:9000;position:absolute;top:0px;left:0px;background:transparent!important;overflow:hidden;display:none;}");B.push(".x-frame-shim-on{width:100%;height:100%;display:block;zoom:1;}");B.push(".ext-ie6 .x-frame-shim{margin-left:5px;margin-top:3px;}");}A.getRule(".x-hide-nosize")||(B.push(".x-hide-nosize,.x-hide-nosize object,.x-hide-nosize iframe{height:0px!important;width:0px!important;border:none;}"));if(!!B.length){A.createStyleSheet(B.join(" "));}});/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/Ext.ux.TinyMCE.min.js *//*--------------------------------------------------*/(function(){Ext.namespace("Ext.ux");var C=false;Ext.ux.TinyMCE=Ext.extend(function(D){var E={tinymceSettings:{accessibility_focus:false}};Ext.apply(E,D);this.addEvents({"editorcreated":true});Ext.ux.TinyMCE.superclass.constructor.call(this,E)},Ext.form.Field,{tinymceSettings:null,defaultAutoCreate:{tag:"div",style:{overflow:"hidden"},children:[{tag:"textarea"}]},width:200,height:200,initComponent:function(){this.tinymceSettings=this.tinymceSettings||{};Ext.ux.TinyMCE.initTinyMCE({language:this.tinymceSettings.language})},onRender:function(G,D){Ext.ux.TinyMCE.superclass.onRender.call(this,G,D);var F=this;var H=this.getEl();if(Ext.type(this.width)=="number"){H.setWidth(this.width);this.tinymceSettings.width=this.width}if(Ext.type(this.height)=="number"){H.setHeight(this.height);this.tinymceSettings.height=this.height}var E=H.child("textarea");this.textareaEl=E;if(this.name){E.set({name:this.name})}var I=E.id;this.ed=new tinymce.Editor(I,this.tinymceSettings);this.ed.onBeforeRenderUI.add(function(K,J){K.controlManager=new A(this,K)}.createDelegate(this));this.ed.onPostRender.add(function(K,J){K.windowManager=new B(this.ed)}.createDelegate(this));this.ed.onInit.add(function(){var K=Ext.get(Ext.DomQuery.selectNode("#"+this.ed.id+"_tbl td.mceToolbar"));var J=K.select("> table.mceToolbar");Ext.DomHelper.append(K,{tag:"div",style:{overflow:"hidden"}},true).appendChild(J)}.createDelegate(this));this.ed.render();tinyMCE.add(this.ed);this.fireEvent("editorcreated")},getName:function(){return this.rendered&&this.textareaEl.dom.name?this.textareaEl.dom.name:(this.name||"")},initValue:function(){if(this.value!==undefined){this.setValue(this.value)}else{var D=this.getEl().child("textarea",true);if(D.value.length>0){this.setValue(D.value)}}},onDestroy:function(){if(this.ed){tinyMCE.remove(this.ed)}Ext.ux.TinyMCE.superclass.onDestroy.call(this)},getValue:function(){if(!this.rendered||!this.ed.initialized){return this.value}var D=this.ed.getContent();if(D===this.emptyText||D===undefined){D=""}return D},setValue:function(D){this.value=D;if(this.rendered){this.withEd(function(){this.ed.undoManager.clear();this.ed.setContent(D===null||D===undefined?"":D);this.ed.startContent=this.ed.getContent({format:"raw"});this.validate()})}},isDirty:function(){if(this.disabled||!this.rendered){return false}return this.ed.isDirty()},syncValue:function(){if(this.rendered&&this.ed.initialized){this.ed.save()}},getEd:function(){return this.ed},onResize:function(E,D){if(this.rendered){this.withEd(function(){if(Ext.type(E)!="number"){E=this.el.getWidth()}if(Ext.type(D)!="number"){D=this.el.getHeight()}this.ed.theme.resizeTo(E,D)})}},focus:function(E,D){Ext.ux.TinyMCE.superclass.focus.call(this,E,D)},onFocus:function(){if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.withEd(function(){this.ed.focus();this.fireEvent("focus",this)})}},withEd:function(D){if(!this.ed){this.on("editorcreated",function(){this.withEd(D)},this)}else{if(this.ed.initialized){D.call(this)}else{this.ed.onInit.add(function(){D.defer(10,this)}.createDelegate(this))}}}});Ext.apply(Ext.ux.TinyMCE,{tinymcePlugins:"safari,pagebreak,style,layer,table,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,noneditable,visualchars,nonbreaking,xhtmlxtras,template",initTinyMCE:function(E){if(!C){var D={mode:"none",plugins:Ext.ux.TinyMCE.tinymcePlugins,theme:"advanced"};Ext.apply(D,E);tinyMCE.init(D);C=true}}});Ext.ComponentMgr.registerType("tinymce",Ext.ux.TinyMCE);var B=Ext.extend(function(D){B.superclass.constructor.call(this,D)},tinymce.WindowManager,{alert:function(E,D,F){Ext.MessageBox.alert("",E,function(){D.call(this)},F)},confirm:function(E,D,F){Ext.MessageBox.confirm("",E,function(G){D.call(this,G=="yes")},F)},open:function(D,F){D=D||{};F=F||{};if(!D.type){this.bookmark=this.editor.selection.getBookmark("simple")}D.width=parseInt(D.width||320);D.height=parseInt(D.height||240)+(tinymce.isIE?8:0);D.min_width=parseInt(D.min_width||150);D.min_height=parseInt(D.min_height||100);D.max_width=parseInt(D.max_width||2000);D.max_height=parseInt(D.max_height||2000);D.movable=D.resizable=true;F.mce_width=D.width;F.mce_height=D.height;F.mce_inline=true;this.features=D;this.params=F;var E=new Ext.Window({title:D.name,width:D.width,height:D.height,minWidth:D.min_width,minHeight:D.min_height,resizable:true,maximizable:D.maximizable==true,minimizable:D.minimizable==true,modal:true,layout:"fit",items:[{xtype:"iframepanel",defaultSrc:D.url||D.file}]});F.mce_window_id=E.getId();E.show(null,function(){if(D.left&&D.top){E.setPagePosition(D.left,D.top)}var G=E.getPosition();D.left=G[0];D.top=G[1];this.onOpen.dispatch(this,D,F)},this);return E},close:function(E){if(!E.tinyMCEPopup||!E.tinyMCEPopup.id){B.superclass.close.call(this,E);return }var D=Ext.getCmp(E.tinyMCEPopup.id);if(D){this.onClose.dispatch(this);D.close()}},setTitle:function(F,E){if(!F.tinyMCEPopup||!F.tinyMCEPopup.id){B.superclass.setTitle.call(this,F,E);return }var D=Ext.getCmp(F.tinyMCEPopup.id);if(D){D.setTitle(E)}},resizeBy:function(E,G,H){var D=Ext.getCmp(H);if(D){var F=D.getSize();D.setSize(F.width+E,F.height+G)}},focus:function(E){var D=Ext.getCmp(E);if(D){D.setActive(true)}}});var A=Ext.extend(function(F,D,E){this.control=F;A.superclass.constructor.call(this,D,E)},tinymce.ControlManager,{control:null,createDropMenu:function(G,E){var D=A.superclass.createDropMenu.call(this,G,E);var F=D.showMenu;D.showMenu=function(H,J,I){F.call(this,H,J,I);Ext.fly("menu_"+this.id).setStyle("z-index",200001)};return D},createColorSplitButton:function(G,E){var D=A.superclass.createColorSplitButton.call(this,G,E);var F=D.showMenu;D.showMenu=function(H,J,I){F.call(this,H,J,I);Ext.fly(this.id+"_menu").setStyle("z-index",200001)};return D}})}())/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/saXMLUtils.pack.js *//*--------------------------------------------------*//*	This program is free software: you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation, either version 3 of the License, or    (at your option) any later version.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program.  If not, see <http://www.gnu.org/licenses/>.*/var XMLObjectifier={xmlToJSON:function(h){try{if(!h){return null}var i={};i.typeOf="JSXBObject";var j=(h.nodeType==9)?h.documentElement:h;i.RootName=j.nodeName||"";if(h.nodeType==3||h.nodeType==4){return h.nodeValue}function trim(s){return s.replace(/^\s+|\s+$/gm,'')}function isNumeric(s){var a="";if(s&&typeof s=="string"){a=s}var b=/^((-)?([0-9]*)((\.{0,1})([0-9]+))?$)/;return b.test(a)}function formatName(a){var b=/-/g;var c=String(a).replace(b,"_");return c}function setAttributes(b,c){if(c.attributes.length>0){var a=c.attributes.length-1;var d;b._attributes=[];do{d=String(formatName(c.attributes[a].name));b._attributes.push(d);b[d]=trim(c.attributes[a].value)}while(a--)}}function setHelpers(g){g.getNodeByAttribute=function(a,b){if(this.length>0){var c;var d=this.length-1;try{do{c=this[d];if(c[a]==b){return c}}while(d--)}catch(e){return false}return false}};g.contains=function(a,b){if(this.length>0){var c=this.length-1;try{do{if(this[c][a]==b){return true}}while(c--)}catch(e){return false}return false}};g.indexOf=function(a,b){var c=-1;if(this.length>0){var d=this.length-1;try{do{if(this[d][a]==b){c=d}}while(d--)}catch(e){return-1}return c}};g.SortByAttribute=function(e,f){if(this.length){function getValue(a,b){var c=a[b];c=(isNumeric(c))?parseFloat(c):c;return c}function sortFn(a,b){var c=0;var d,tB;d=getValue(a,e);tB=getValue(b,e);if(d<tB){c=-1}else if(tB<d){c=1}if(f){c=(f.toUpperCase()=="DESC")?(0-c):c}return c}this.sort(sortFn)}};g.SortByValue=function(e){if(this.length){function getValue(a){var b=a.Text;b=(isNumeric(b))?parseFloat(b):b;return b}function sortFn(a,b){var c=0;var d,tB;d=getValue(a);tB=getValue(b);if(d<tB){c=-1}else if(tB<d){c=1}if(e){c=(e.toUpperCase()=="DESC")?(0-c):c}return c}this.sort(sortFn)}};g.SortByNode=function(e,f){if(this.length){function getValue(a,b){var c=a[b][0].Text;c=(isNumeric(c))?parseFloat(c):c;return c}function sortFn(a,b){var c=0;var d,tB;d=getValue(a,e);tB=getValue(b,e);if(d<tB){c=-1}else if(tB<d){c=1}if(f){c=(f.toUpperCase()=="DESC")?(0-c):c}return c}this.sort(sortFn)}}}function setObjects(a,b){var c;var d;var e;var f="";if(!b){return null}if(b.attributes.length>0){setAttributes(a,b)}a.Text="";if(b.hasChildNodes()){var g=b.childNodes.length-1;var n=0;do{d=b.childNodes[n];switch(d.nodeType){case 1:a._children=[];c=(d.localName)?d.localName:d.baseName;c=formatName(c);if(f!=c){a._children.push(c)}if(!a[c]){a[c]=[]}e={};a[c].push(e);if(d.attributes.length>0){setAttributes(e,d)}if(!a[c].contains){setHelpers(a[c])}f=c;if(d.hasChildNodes()){setObjects(e,d)}break;case 3:a.Text+=trim(d.nodeValue);break;case 4:a.Text+=(d.text)?trim(d.text):trim(d.nodeValue);break}}while(n++<g)}}setObjects(i,j);h=null;j=null;return i}catch(e){return null}},textToXML:function(a){var b=null;try{b=(document.all)?new ActiveXObject("Microsoft.XMLDOM"):new DOMParser();b.async=false}catch(e){throw new Error("XML Parser could not be instantiated");}var c;try{if(document.all){c=(b.loadXML(a))?b:false}else{c=b.parseFromString(a,"text/xml")}}catch(e){throw new Error("Error parsing XML string");}return c}};/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/xml2json.js *//*--------------------------------------------------*//*	This work is licensed under Creative Commons GNU LGPL License.	License: http://creativecommons.org/licenses/LGPL/2.1/   Version: 0.9	Author:  Stefan Goessner/2006	Web:     http://goessner.net/ */function xml2json(xml, tab) {   var X = {      toObj: function(xml) {         var o = {};         if (xml.nodeType==1) {   // element node ..            if (xml.attributes.length)   // element with attributes  ..               for (var i=0; i<xml.attributes.length; i++)                  o["@"+xml.attributes[i].nodeName] = (xml.attributes[i].nodeValue||"").toString();            if (xml.firstChild) { // element has child nodes ..               var textChild=0, cdataChild=0, hasElementChild=false;               for (var n=xml.firstChild; n; n=n.nextSibling) {                  if (n.nodeType==1) hasElementChild = true;                  else if (n.nodeType==3 && n.nodeValue.match(/[^ \f\n\r\t\v]/)) textChild++; // non-whitespace text                  else if (n.nodeType==4) cdataChild++; // cdata section node               }               if (hasElementChild) {                  if (textChild < 2 && cdataChild < 2) { // structured element with evtl. a single text or/and cdata node ..                     X.removeWhite(xml);                     for (var n=xml.firstChild; n; n=n.nextSibling) {                        if (n.nodeType == 3)  // text node                           o["#text"] = X.escape(n.nodeValue);                        else if (n.nodeType == 4)  // cdata node                           //o["#cdata"] = X.escape(n.nodeValue);                           o = X.escape(n.nodeValue);                        else if (o[n.nodeName]) {  // multiple occurence of element ..                           if (o[n.nodeName] instanceof Array)                              o[n.nodeName][o[n.nodeName].length] = X.toObj(n);                           else                              o[n.nodeName] = [o[n.nodeName], X.toObj(n)];                        }                        else  // first occurence of element..                           o[n.nodeName] = X.toObj(n);                     }                  }                  else { // mixed content                     if (!xml.attributes.length)                        o = X.escape(X.innerXml(xml));                     else                        o["#text"] = X.escape(X.innerXml(xml));                  }               }               else if (textChild) { // pure text                  if (!xml.attributes.length)                     o = X.escape(X.innerXml(xml));                  else                     o["#text"] = X.escape(X.innerXml(xml));               }               else if (cdataChild) { // cdata                  if (cdataChild > 1)                     o = X.escape(X.innerXml(xml));                  else                     for (var n=xml.firstChild; n; n=n.nextSibling)                        //o["#cdata"] = X.escape(n.nodeValue);                        o = X.escape(n.nodeValue);               }            }            if (!xml.attributes.length && !xml.firstChild) o = null;         }         else if (xml.nodeType==9) { // document.node            o = X.toObj(xml.documentElement);         }         else            alert("unhandled node type: " + xml.nodeType);         return o;      },      /*      toJson: function(o, name, ind) {         var json = name ? ("\""+name+"\"") : "";         if (o instanceof Array) {            for (var i=0,n=o.length; i<n; i++)               o[i] = X.toJson(o[i], "", ind+"\t");            json += (name?":[":"[") + (o.length > 1 ? ("\n"+ind+"\t"+o.join(",\n"+ind+"\t")+"\n"+ind) : o.join("")) + "]";         }         else if (o == null)            json += (name&&":") + "null";         else if (typeof(o) == "object") {            var arr = [];            for (var m in o)               arr[arr.length] = X.toJson(o[m], m, ind+"\t");            json += (name?":{":"{") + (arr.length > 1 ? ("\n"+ind+"\t"+arr.join(",\n"+ind+"\t")+"\n"+ind) : arr.join("")) + "}";         }         else if (typeof(o) == "string")            json += (name&&":") + "\"" + o.toString() + "\"";         else            json += (name&&":") + o.toString();         return json;      },      */      innerXml: function(node) {         var s = ""         if ("innerHTML" in node)            s = node.innerHTML;         else {            var asXml = function(n) {               var s = "";               if (n.nodeType == 1) {                  s += "<" + n.nodeName;                  for (var i=0; i<n.attributes.length;i++)                     s += " " + n.attributes[i].nodeName + "=\"" + (n.attributes[i].nodeValue||"").toString() + "\"";                  if (n.firstChild) {                     s += ">";                     for (var c=n.firstChild; c; c=c.nextSibling)                        s += asXml(c);                     s += "</"+n.nodeName+">";                  }                  else                     s += "/>";               }               else if (n.nodeType == 3)                  s += n.nodeValue;               else if (n.nodeType == 4)                  s += "<![CDATA[" + n.nodeValue + "]]>";               return s;            };            for (var c=node.firstChild; c; c=c.nextSibling)               s += asXml(c);         }         return s;      },      escape: function(txt) {         return txt.replace(/[\\]/g, "\\\\")                   .replace(/[\"]/g, '\\"')                   .replace(/[\n]/g, '\\n')                   .replace(/[\r]/g, '\\r');      },      removeWhite: function(e) {         e.normalize();         for (var n = e.firstChild; n; ) {            if (n.nodeType == 3) {  // text node               if (!n.nodeValue.match(/[^ \f\n\r\t\v]/)) { // pure whitespace text node                  var nxt = n.nextSibling;                  e.removeChild(n);                  n = nxt;               }               else                  n = n.nextSibling;            }            else if (n.nodeType == 1) {  // element node               X.removeWhite(n);               n = n.nextSibling;            }            else                      // any other node               n = n.nextSibling;         }         return e;      }   };   if (xml.nodeType == 9) // document node      xml = xml.documentElement;      //var json = X.toJson(X.toObj(X.removeWhite(xml)), xml.nodeName, "\t");   //return "{\n" + tab + (tab ? json.replace(/\t/g, tab) : json.replace(/\t|\n/g, "")) + "\n}";      var json = X.toObj(X.removeWhite(xml));   return json;   }/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/jsgantt.js *//*--------------------------------------------------*//* Copyright (c) 2008, Shlomy Gantz BlueBrick Inc.* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions are met:*     * Redistributions of source code must retain the above copyright*       notice, this list of conditions and the following disclaimer.*     * Redistributions in binary form must reproduce the above copyright*       notice, this list of conditions and the following disclaimer in the*       documentation and/or other materials provided with the distribution.*     * Neither the name of Shlomy Gantz or BlueBrick Inc. nor the*       names of its contributors may be used to endorse or promote products*       derived from this software without specific prior written permission.** THIS SOFTWARE IS PROVIDED BY SHLOMY GANTZ/BLUEBRICK INC. ''AS IS'' AND ANY* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE* DISCLAIMED. IN NO EVENT SHALL SHLOMY GANTZ/BLUEBRICK INC. BE LIABLE FOR ANY* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/   // function that loads each Task Item and fills TaskList array with each task attributes.   // You should be able to add items to the chart in realtime via javascript and issuing "g.Draw()" command.   // Parameters:   // pID: (required) is a unique ID used to identify each row for parent functions and for setting dom id for hiding/showing   // pName: (required) is the task Label   // pStart: (required) the task start date, can enter empty date ('') for groups   // pEnd: (required) the task end date, can enter empty date ('') for groups   // pColor: (required) the html color for this task; e.g. '00ff00'   // pLink: (optional) any http link navigated to when task bar is clicked.   // pMile: UNUSED - in future will represent a milestone   // pRes: (optional) resource name   // pComp: (required) completion percent   // pGroup: (optional) indicates whether this is a group(parent) - 0=NOT Parent; 1=IS Parent   // pParent: (required) identifies a parent pID, this causes this task to be a child of identified task   // pOpen: UNUSED - in future can be initially set to close folder when chart is first drawnvar JSGantt; if (!JSGantt) JSGantt = {};var vTimeout = 0;var vBenchTime = new Date().getTime();//function JSGantt() {}JSGantt.isIE = function () {		if(typeof document.all != 'undefined')		return true;	else		return false;}JSGantt.TaskItem = function(pID, pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption){      var vID    = pID;      var vName  = pName;      var vStart = new Date();	      var vEnd   = new Date();      var vColor = pColor;      var vLink  = pLink;      var vMile  = pMile;      var vRes   = pRes;      var vComp  = pComp;      var vGroup = pGroup;      var vParent = pParent;      var vOpen   = pOpen;      var vDepend = pDepend;      var vCaption = pCaption;      var vDuration = '';      var vLevel = 0;      var vNumKid = 0;      var vVisible  = 1;      var x1, y1, x2, y2;      if (vGroup != 1)      {           vStart = JSGantt.parseDateStr(pStart,g.getDateInputFormat());         vEnd   = JSGantt.parseDateStr(pEnd,g.getDateInputFormat());      }      this.getID       = function(){ return vID };      this.getName     = function(){ return vName };      this.getStart    = function(){ return vStart};      this.getEnd      = function(){ return vEnd  };      this.getColor    = function(){ return vColor};      this.getLink     = function(){ return vLink };      this.getMile     = function(){ return vMile };      this.getDepend   = function(){ if(vDepend) return vDepend; else return null };      this.getCaption  = function(){ if(vCaption) return vCaption; else return ''; };      this.getResource = function(){ if(vRes) return vRes; else return '&nbsp';  };      this.getCompVal  = function(){ if(vComp) return vComp; else return 0; };      this.getCompStr  = function(){ if(vComp) return vComp+'%'; else return '0%'; };      this.getDuration = function(vFormat){          if (vMile)             vDuration = '-'; 		   else { //if(vFormat == 'day') {            tmpPer =  Math.ceil((this.getEnd() - this.getStart()) /  (24 * 60 * 60 * 1000) + 1);            if(tmpPer == 1)  vDuration = '1 Day';            else             vDuration = tmpPer + ' Days';         }         //else if(vFormat == 'week') {         //   tmpPer =  ((this.getEnd() - this.getStart()) /  (24 * 60 * 60 * 1000) + 1)/7;         //   if(tmpPer == 1)  vDuration = '1 Week';         //   else             vDuration = tmpPer + ' Weeks';          //}         //else if(vFormat == 'month') {         //   tmpPer =  ((this.getEnd() - this.getStart()) /  (24 * 60 * 60 * 1000) + 1)/30;         //   if(tmpPer == 1) vDuration = '1 Month';         //   else            vDuration = tmpPer + ' Months';          //}         //else if(vFormat == 'quater') {         //   tmpPer =  ((this.getEnd() - this.getStart()) /  (24 * 60 * 60 * 1000) + 1)/120;         //   if(tmpPer == 1) vDuration = '1 Qtr';         //   else            vDuration = tmpPer + ' Qtrs';          //}         return( vDuration )      };      this.getParent   = function(){ return vParent };      this.getGroup    = function(){ return vGroup };      this.getOpen     = function(){ return vOpen };      this.getLevel    = function(){ return vLevel };      this.getNumKids  = function(){ return vNumKid };      this.getStartX   = function(){ return x1 };      this.getStartY   = function(){ return y1 };      this.getEndX     = function(){ return x2 };      this.getEndY     = function(){ return y2 };      this.getVisible  = function(){ return vVisible };	   this.setDepend   = function(pDepend){ vDepend = pDepend;};      this.setStart    = function(pStart){ vStart = pStart;};      this.setEnd      = function(pEnd)  { vEnd   = pEnd;  };      this.setLevel    = function(pLevel){ vLevel = pLevel;};      this.setNumKid   = function(pNumKid){ vNumKid = pNumKid;};      this.setCompVal  = function(pCompVal){ vComp = pCompVal;};      this.setStartX   = function(pX) {x1 = pX; };      this.setStartY   = function(pY) {y1 = pY; };      this.setEndX     = function(pX) {x2 = pX; };      this.setEndY     = function(pY) {y2 = pY; };      this.setOpen     = function(pOpen) {vOpen = pOpen; };      this.setVisible  = function(pVisible) {vVisible = pVisible; };  }	  // function that loads the main gantt chart properties and functions  // pDiv: (required) this is a DIV object created in HTML  // pStart: UNUSED - future use to force minimum chart date  // pEnd: UNUSED - future use to force maximum chart date  // pWidth: UNUSED - future use to force chart width and cause objects to scale to fit within that width  // pShowRes: UNUSED - future use to turn on/off display of resource names  // pShowDur: UNUSED - future use to turn on/off display of task durations  // pFormat: (required) - used to indicate whether chart should be drawn in "day", "week", "month", or "quarter" format  // pCationType - what type of Caption to show:  Caption, Resource, Duration, CompleteJSGantt.GanttChart =  function(pGanttVar, pDiv, pFormat){      var vGanttVar = pGanttVar;      var vDiv      = pDiv;      var vFormat   = pFormat;      var vShowRes  = 1;      var vShowDur  = 1;      var vShowComp = 1;      var vShowStartDate = 1;      var vShowEndDate = 1;      var vDateInputFormat = (Eve.Preference.get('dateFormat') == 'n/j/y') ?"mm/dd/yy" : "dd/mm/yyyy";//changed by Ghazal      var vDateDisplayFormat = (Eve.Preference.get('dateFormat') == 'n/j/y') ?"mm/dd/yy" : "dd/mm/yyyy";//changed by Ghazal	   var vNumUnits  = 0;      var vCaptionType;      var vDepId = 1;      var vTaskList     = new Array();		      var vQuarterArr   = new Array(1,1,1,2,2,2,3,3,3,4,4,4);      var vMonthDaysArr = new Array(31,28,31,30,31,30,31,31,30,31,30,31);      var vMonthArr     = new Array("January","February","March","April","May","June","July",                          "August","September","October","November","December");      this.setShowRes  = function(pShow) { vShowRes  = pShow; };      this.setShowDur  = function(pShow) { vShowDur  = pShow; };      this.setShowComp = function(pShow) { vShowComp = pShow; };      this.setShowStartDate = function(pShow) { vShowStartDate = pShow; };      this.setShowEndDate = function(pShow) { vShowEndDate = pShow; };      this.setDateInputFormat = function(pShow) { vDateInputFormat = pShow; };      this.setDateDisplayFormat = function(pShow) { vDateDisplayFormat = pShow; };      this.setCaptionType = function(pType) { vCaptionType = pType };      this.setFormat = function(pFormat){          vFormat = pFormat;          this.Draw();       };      this.getShowRes  = function(){ return vShowRes };      this.getShowDur  = function(){ return vShowDur };      this.getShowComp = function(){ return vShowComp };	   this.getShowStartDate = function(){ return vShowStartDate };	   this.getShowEndDate = function(){ return vShowEndDate };      this.getDateInputFormat = function() { return vDateInputFormat };      this.getDateDisplayFormat = function() { return vDateDisplayFormat };      this.getCaptionType = function() { return vCaptionType };      this.CalcTaskXY = function ()       {         var vList = this.getList();         var vTaskDiv;         var vParDiv;         var vLeft, vTop, vHeight, vWidth;         for(i = 0; i < vList.length; i++)         {            vID = vList[i].getID();            vTaskDiv = document.getElementById("taskbar_"+vID);            vBarDiv  = document.getElementById("bardiv_"+vID);            vParDiv  = document.getElementById("childgrid_"+vID);            if(vBarDiv) {               vList[i].setStartX( vBarDiv.offsetLeft );               vList[i].setStartY( vParDiv.offsetTop+vBarDiv.offsetTop+6 );               vList[i].setEndX( vBarDiv.offsetLeft + vBarDiv.offsetWidth );               vList[i].setEndY( vParDiv.offsetTop+vBarDiv.offsetTop+6 );            }         }      }      this.AddTaskItem = function(value)      {         vTaskList.push(value);      }      this.getList   = function() { return vTaskList };      this.clearDependencies = function()      {         var parent = document.getElementById('rightside');         var depLine;         var vMaxId = vDepId;         for ( i=1; i<vMaxId; i++ ) {            depLine = document.getElementById("line"+i);            if (depLine) { parent.removeChild(depLine); }         }         vDepId = 1;      }      // sLine: Draw a straight line (colored one-pixel wide DIV), need to parameterize doc item      this.sLine = function(x1,y1,x2,y2) {         vLeft = Math.min(x1,x2);         vTop  = Math.min(y1,y2);         vWid  = Math.abs(x2-x1) + 1;         vHgt  = Math.abs(y2-y1) + 1;         vDoc = document.getElementById('rightside');	 // retrieve DIV	 var oDiv = document.createElement('div');	 oDiv.id = "line"+vDepId++;         oDiv.style.position = "absolute";	 oDiv.style.margin = "0px";	 oDiv.style.padding = "0px";	 oDiv.style.overflow = "hidden";	 oDiv.style.border = "0px";	 // set attributes	 oDiv.style.zIndex = 0;	 oDiv.style.backgroundColor = "red";		 oDiv.style.left = vLeft + "px";	 oDiv.style.top = vTop + "px";	 oDiv.style.width = vWid + "px";	 oDiv.style.height = vHgt + "px";	 oDiv.style.visibility = "visible";		 vDoc.appendChild(oDiv);      }      // dLine: Draw a diaganol line (calc line x,y paisrs and draw multiple one-by-one sLines)      this.dLine = function(x1,y1,x2,y2) {         var dx = x2 - x1;         var dy = y2 - y1;         var x = x1;         var y = y1;         var n = Math.max(Math.abs(dx),Math.abs(dy));         dx = dx / n;         dy = dy / n;         for ( i = 0; i <= n; i++ )         {            vx = Math.round(x);             vy = Math.round(y);            this.sLine(vx,vy,vx,vy);            x += dx;            y += dy;         }      }      this.drawDependency =function(x1,y1,x2,y2)      {         if(x1 + 10 < x2)         {             this.sLine(x1,y1,x1+4,y1);            this.sLine(x1+4,y1,x1+4,y2);            this.sLine(x1+4,y2,x2,y2);            this.dLine(x2,y2,x2-3,y2-3);            this.dLine(x2,y2,x2-3,y2+3);            this.dLine(x2-1,y2,x2-3,y2-2);            this.dLine(x2-1,y2,x2-3,y2+2);         }         else         {            this.sLine(x1,y1,x1+4,y1);            this.sLine(x1+4,y1,x1+4,y2-10);            this.sLine(x1+4,y2-10,x2-8,y2-10);            this.sLine(x2-8,y2-10,x2-8,y2);            this.sLine(x2-8,y2,x2,y2);            this.dLine(x2,y2,x2-3,y2-3);            this.dLine(x2,y2,x2-3,y2+3);            this.dLine(x2-1,y2,x2-3,y2-2);            this.dLine(x2-1,y2,x2-3,y2+2);         }      }      this.DrawDependencies = function () {         //First recalculate the x,y         this.CalcTaskXY();         this.clearDependencies();         var vList = this.getList();         for(var i = 0; i < vList.length; i++)         {            vDepend = vList[i].getDepend();            if(vDepend) {                        var vDependStr = vDepend + '';               var vDepList = vDependStr.split(',');               var n = vDepList.length;               for(var k=0;k<n;k++) {                  var vTask = this.getArrayLocationByID(vDepList[k]);                  if(vList[vTask].getVisible()==1)                     this.drawDependency(vList[vTask].getEndX(),vList[vTask].getEndY(),vList[i].getStartX()-1,vList[i].getStartY())               }  	    }         }      }      this.getArrayLocationByID = function(pId)  {         var vList = this.getList();         for(var i = 0; i < vList.length; i++)         {            if(vList[i].getID()==pId)               return i;         }      }   this.Draw = function()   {      var vMaxDate = new Date();      var vMinDate = new Date();	      var vTmpDate = new Date();      var vNxtDate = new Date();      var vCurrDate = new Date();      var vTaskLeft = 0;      var vTaskRight = 0;      var vNumCols = 0;      var vID = 0;      var vMainTable = "";      var vLeftTable = "";      var vRightTable = "";      var vDateRowStr = "";      var vItemRowStr = "";      var vColWidth = 0;      var vColUnit = 0;      var vChartWidth = 0;      var vNumDays = 0;      var vDayWidth = 0;      var vStr = "";      var vNameWidth = 220;	      var vStatusWidth = 70;      var vLeftWidth = 15 + 220 + 70 + 70 + 70 + 70 + 70;      if(vTaskList.length > 0)      {        		   // Process all tasks preset parent date and completion %         JSGantt.processRows(vTaskList, 0, -1, 1, 1);         // get overall min/max dates plus padding         vMinDate = JSGantt.getMinDate(vTaskList, vFormat);         vMaxDate = JSGantt.getMaxDate(vTaskList, vFormat);         // Calculate chart width variables.  vColWidth can be altered manually to change each column width         // May be smart to make this a parameter of GanttChart or set it based on existing pWidth parameter         if(vFormat == 'day') {            vColWidth = 18;            vColUnit = 1;         }         else if(vFormat == 'week') {            vColWidth = 37;            vColUnit = 7;         }         else if(vFormat == 'month') {            vColWidth = 37;            vColUnit = 30;         }         else if(vFormat == 'quarter') {            vColWidth = 60;            vColUnit = 90;         }         vNumDays = Math.ceil((Date.parse(vMaxDate) - Date.parse(vMinDate)) / ( 24 * 60 * 60 * 1000));         vNumUnits = vNumDays / vColUnit;         vChartWidth = vNumUnits * vColWidth + 1;         vDayWidth = (vColWidth / vColUnit) + (1/vColUnit);	 //debugger;         vMainTable =            '<TABLE id=theTable cellSpacing=0 cellPadding=0 border=0><TBODY><TR>' +            '<TD vAlign=top bgColor=#ffffff>';         if(vShowRes !=1) vNameWidth+=vStatusWidth;         if(vShowDur !=1) vNameWidth+=vStatusWidth;         if(vShowComp!=1) vNameWidth+=vStatusWidth;		   if(vShowStartDate!=1) vNameWidth+=vStatusWidth;		   if(vShowEndDate!=1) vNameWidth+=vStatusWidth;        		   // DRAW the Left-side of the chart (names, resources, comp%)         vLeftTable =            '<DIV class=scroll id=leftside style="width:' + vLeftWidth + 'px"><TABLE cellSpacing=0 cellPadding=0 border=0><TBODY>' +            '<TR style="HEIGHT: 17px">' +            '  <TD style="WIDTH: 15px; HEIGHT: 17px"></TD>' +            '  <TD style="WIDTH: ' + vNameWidth + 'px; HEIGHT: 17px"><NOBR></NOBR></TD>';          if(vShowRes ==1) vLeftTable += '  <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;         if(vShowDur ==1) vLeftTable += '  <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;         if(vShowComp==1) vLeftTable += '  <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;			if(vShowStartDate==1) vLeftTable += '  <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;			if(vShowEndDate==1) vLeftTable += '  <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;         vLeftTable +=            '<TR style="HEIGHT: 20px">' +            '  <TD style="BORDER-TOP: #efefef 1px solid; WIDTH: 15px; HEIGHT: 20px"></TD>' +            '  <TD style="BORDER-TOP: #efefef 1px solid; WIDTH: ' + vNameWidth + 'px; HEIGHT: 20px">Name</TD>' ;         if(vShowRes ==1) vLeftTable += '  <TD style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 60px; HEIGHT: 20px" align=center nowrap>Resource</TD>' ;         if(vShowDur ==1) vLeftTable += '  <TD style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 60px; HEIGHT: 20px" align=center nowrap>Duration</TD>' ;         if(vShowComp==1) vLeftTable += '  <TD style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 60px; HEIGHT: 20px" align=center nowrap>% Comp.</TD>' ;         if(vShowStartDate==1) vLeftTable += '  <TD style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 60px; HEIGHT: 20px" align=center nowrap>Start</TD>' ;         if(vShowEndDate==1) vLeftTable += '  <TD style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 60px; HEIGHT: 20px" align=center nowrap>Due</TD>' ;          vLeftTable += '</TR>';            for(i = 0; i < vTaskList.length; i++)            {               if( vTaskList[i].getGroup()) {                  vBGColor = "f3f3f3";                  vRowType = "group";               } else {                  vBGColor  = "ffffff";                  vRowType  = "row";               }                              vID = vTaskList[i].getID();  		         if(vTaskList[i].getVisible() == 0)                   vLeftTable += '<TR id=child_' + vID + ' bgcolor=#' + vBGColor + ' style="display:none"  onMouseover=g.mouseOver(this,' + vID + ',"left","' + vRowType + '") onMouseout=g.mouseOut(this,' + vID + ',"left","' + vRowType + '")>' ;			      else                 vLeftTable += '<TR id=child_' + vID + ' bgcolor=#' + vBGColor + ' onMouseover=g.mouseOver(this,' + vID + ',"left","' + vRowType + '") onMouseout=g.mouseOut(this,' + vID + ',"left","' + vRowType + '")>' ;			      vLeftTable +=                   '  <TD class=gdatehead style="WIDTH: 15px; HEIGHT: 20px; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;">&nbsp;</TD>' +                  '  <TD class=gname style="WIDTH: ' + vNameWidth + 'px; HEIGHT: 20px; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px;" nowrap><NOBR><span style="color: #aaaaaa">';               for(j=1; j<vTaskList[i].getLevel(); j++) {                  vLeftTable += '&nbsp&nbsp&nbsp&nbsp';               }               vLeftTable += '</span>';               if( vTaskList[i].getGroup()) {                  if( vTaskList[i].getOpen() == 1)                      vLeftTable += '<SPAN id="group_' + vID + '" style="color:#000000; cursor:pointer; font-weight:bold; FONT-SIZE: 12px;" onclick="JSGantt.folder(' + vID + ','+vGanttVar+');'+vGanttVar+'.DrawDependencies();">&ndash;</span><span style="color:#000000">&nbsp</SPAN>' ;                  else                     vLeftTable += '<SPAN id="group_' + vID + '" style="color:#000000; cursor:pointer; font-weight:bold; FONT-SIZE: 12px;" onclick="JSGantt.folder(' + vID + ','+vGanttVar+');'+vGanttVar+'.DrawDependencies();">+</span><span style="color:#000000">&nbsp</SPAN>' ;				                } else {                  vLeftTable += '<span style="color: #000000; font-weight:bold; FONT-SIZE: 12px;">&nbsp&nbsp&nbsp</span>';               }//               vLeftTable += //                  '<span onclick=JSGantt.taskLink("' + vTaskList[i].getLink() + '",300,200); style="cursor:pointer"> ' + vTaskList[i].getName() + '</span></NOBR></TD>' ;               vLeftTable +=                   '<span> ' + vTaskList[i].getName() + '</span></NOBR></TD>' ;               if(vShowRes ==1) vLeftTable += '  <TD class=gname style="WIDTH: 60px; HEIGHT: 20px; TEXT-ALIGN: center; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><NOBR>' + vTaskList[i].getResource() + '</NOBR></TD>' ;               if(vShowDur ==1) vLeftTable += '  <TD class=gname style="WIDTH: 60px; HEIGHT: 20px; TEXT-ALIGN: center; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><NOBR>' + vTaskList[i].getDuration(vFormat) + '</NOBR></TD>' ;               if(vShowComp==1) vLeftTable += '  <TD class=gname style="WIDTH: 60px; HEIGHT: 20px; TEXT-ALIGN: center; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><NOBR>' + vTaskList[i].getCompStr()  + '</NOBR></TD>' ;               if(vShowStartDate==1) vLeftTable += '  <TD class=gname style="WIDTH: 60px; HEIGHT: 20px; TEXT-ALIGN: center; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><NOBR>' + JSGantt.formatDateStr( vTaskList[i].getStart(), vDateDisplayFormat) + '</NOBR></TD>' ;               if(vShowEndDate==1) vLeftTable += '  <TD class=gname style="WIDTH: 60px; HEIGHT: 20px; TEXT-ALIGN: center; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><NOBR>' + JSGantt.formatDateStr( vTaskList[i].getEnd(), vDateDisplayFormat) + '</NOBR></TD>' ;               vLeftTable += '</TR>';            }            // DRAW the date format selector at bottom left.  Another potential GanttChart parameter to hide/show this selector            vLeftTable += '</TD></TR>' +              '<TR><TD border=1 colspan=5 align=left style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 11px; BORDER-LEFT: #efefef 1px solid; height=18px">Format:';		            if (vFormat=='day') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="day" checked>Day';            else                vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("day",'+vGanttVar+'); VALUE="day">Day';            if (vFormat=='week') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="week" checked>Week';            else                vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("week",'+vGanttVar+') VALUE="week">Week';            if (vFormat=='month') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="month" checked>Month';            else                vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("month",'+vGanttVar+') VALUE="month">Month';            if (vFormat=='quarter') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="quarter" checked>Quarter';            else                vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("quarter",'+vGanttVar+') VALUE="quarter">Quarter';//            vLeftTable += '<INPUT TYPE=RADIO NAME="other" VALUE="other" style="display:none"> .';            vLeftTable += '</TD></TR></TBODY></TABLE></TD>';            vMainTable += vLeftTable;            // Draw the Chart Rows            vRightTable =             '<TD style="width: ' + vChartWidth + 'px;" vAlign=top bgColor=#ffffff>' +            '<DIV class=scroll2 id=rightside>' +            '<TABLE style="width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +            '<TBODY><TR style="HEIGHT: 18px">';            vTmpDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());         // Major Date Header         while(Date.parse(vTmpDate) <= Date.parse(vMaxDate))         {	            vStr = vTmpDate.getFullYear() + '';            vStr = vStr.substring(2,4);  	         if(vFormat == 'day')            {			      vRightTable += '<td class=gdatehead style="FONT-SIZE: 12px; HEIGHT: 19px;" align=center colspan=7>' +			      JSGantt.formatDateStr(vTmpDate,vDateDisplayFormat.substring(0,5)) + ' - ';               vTmpDate.setDate(vTmpDate.getDate()+6);		         vRightTable += JSGantt.formatDateStr(vTmpDate, vDateDisplayFormat) + '</td>';               vTmpDate.setDate(vTmpDate.getDate()+1);            }            else if(vFormat == 'week')            {  		         vRightTable += '<td class=gdatehead align=center style="FONT-SIZE: 12px; HEIGHT: 19px;" width='+vColWidth+'px>`'+ vStr + '</td>';               vTmpDate.setDate(vTmpDate.getDate()+7);            }            else if(vFormat == 'month')            {	            vRightTable += '<td class=gdatehead align=center style="FONT-SIZE: 12px; HEIGHT: 19px;" width='+vColWidth+'px>`'+ vStr + '</td>';               vTmpDate.setDate(vTmpDate.getDate() + 1);               while(vTmpDate.getDate() > 1)               {                 vTmpDate.setDate(vTmpDate.getDate() + 1);               }            }            else if(vFormat == 'quarter')            {	            vRightTable += '<td class=gdatehead align=center style="FONT-SIZE: 12px; HEIGHT: 19px;" width='+vColWidth+'px>`'+ vStr + '</td>';               vTmpDate.setDate(vTmpDate.getDate() + 81);               while(vTmpDate.getDate() > 1)               {                 vTmpDate.setDate(vTmpDate.getDate() + 1);               }            }         }         vRightTable += '</TR><TR>';         // Minor Date header and Cell Rows         vTmpDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());         vNxtDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());         vNumCols = 0;          while(Date.parse(vTmpDate) <= Date.parse(vMaxDate))         {		         if(vFormat == 'day')             {               if( JSGantt.formatDateStr(vCurrDate,'mm/dd/yyyy') == JSGantt.formatDateStr(vTmpDate,'mm/dd/yyyy')) {                  vWeekdayColor  = "ccccff";                  vWeekendColor  = "9999ff";                  vWeekdayGColor  = "bbbbff";                  vWeekendGColor = "8888ff";               } else {                  vWeekdayColor = "ffffff";                  vWeekendColor = "cfcfcf";                  vWeekdayGColor = "f3f3f3";                  vWeekendGColor = "c3c3c3";               }                              if(vTmpDate.getDay() % 6 == 0) {                  vDateRowStr  += '<td class="gheadwkend" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekendColor + ' align=center><div style="width: '+vColWidth+'px">' + vTmpDate.getDate() + '</div></td>';                  vItemRowStr  += '<td class="gheadwkend" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; cursor: default;"  bgcolor=#' + vWeekendColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp</div></td>';               }               else {                  vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid;"  bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">' + vTmpDate.getDate() + '</div></td>';                  if( JSGantt.formatDateStr(vCurrDate,'mm/dd/yyyy') == JSGantt.formatDateStr(vTmpDate,'mm/dd/yyyy'))                      vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; cursor: default;"  bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';                  else                     vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; cursor: default;"  align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';               }               vTmpDate.setDate(vTmpDate.getDate() + 1);            }	         else if(vFormat == 'week')            {               vNxtDate.setDate(vNxtDate.getDate() + 7);               if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )                   vWeekdayColor = "ccccff";               else                  vWeekdayColor = "ffffff";               if(vNxtDate <= vMaxDate) {                  vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center width:'+vColWidth+'px><div style="width: '+vColWidth+'px">' + (vTmpDate.getMonth()+1) + '/' + vTmpDate.getDate() + '</div></td>';                  if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )                      vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';                  else                     vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';               } else {                  vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid; bgcolor=#' + vWeekdayColor + ' BORDER-RIGHT: #efefef 1px solid;" align=center width:'+vColWidth+'px><div style="width: '+vColWidth+'px">' + (vTmpDate.getMonth()+1) + '/' + vTmpDate.getDate() + '</div></td>';                  if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )                      vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';                  else                     vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';               }               vTmpDate.setDate(vTmpDate.getDate() + 7);            }	         else if(vFormat == 'month')            {               vNxtDate.setFullYear(vTmpDate.getFullYear(), vTmpDate.getMonth(), vMonthDaysArr[vTmpDate.getMonth()]);               if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )                   vWeekdayColor = "ccccff";               else                  vWeekdayColor = "ffffff";               if(vNxtDate <= vMaxDate) {                  vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center width:'+vColWidth+'px><div style="width: '+vColWidth+'px">' + vMonthArr[vTmpDate.getMonth()].substr(0,3) + '</div></td>';                  if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )                      vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';                  else                     vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';               } else {                  vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center width:'+vColWidth+'px><div style="width: '+vColWidth+'px">' + vMonthArr[vTmpDate.getMonth()].substr(0,3) + '</div></td>';                  if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )                      vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';                  else                     vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';               }               vTmpDate.setDate(vTmpDate.getDate() + 1);               while(vTmpDate.getDate() > 1)                {                  vTmpDate.setDate(vTmpDate.getDate() + 1);               }            }	         else if(vFormat == 'quarter')            {               vNxtDate.setDate(vNxtDate.getDate() + 122);               if( vTmpDate.getMonth()==0 || vTmpDate.getMonth()==1 || vTmpDate.getMonth()==2 )                  vNxtDate.setFullYear(vTmpDate.getFullYear(), 2, 31);               else if( vTmpDate.getMonth()==3 || vTmpDate.getMonth()==4 || vTmpDate.getMonth()==5 )                  vNxtDate.setFullYear(vTmpDate.getFullYear(), 5, 30);               else if( vTmpDate.getMonth()==6 || vTmpDate.getMonth()==7 || vTmpDate.getMonth()==8 )                  vNxtDate.setFullYear(vTmpDate.getFullYear(), 8, 30);               else if( vTmpDate.getMonth()==9 || vTmpDate.getMonth()==10 || vTmpDate.getMonth()==11 )                  vNxtDate.setFullYear(vTmpDate.getFullYear(), 11, 31);               if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )                   vWeekdayColor = "ccccff";               else                  vWeekdayColor = "ffffff";               if(vNxtDate <= vMaxDate) {                  vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center width:'+vColWidth+'px><div style="width: '+vColWidth+'px">Qtr. ' + vQuarterArr[vTmpDate.getMonth()] + '</div></td>';                  if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )                      vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';                  else                     vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';               } else {                  vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center width:'+vColWidth+'px><div style="width: '+vColWidth+'px">Qtr. ' + vQuarterArr[vTmpDate.getMonth()] + '</div></td>';                  if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )                      vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';                  else                      vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';               }               vTmpDate.setDate(vTmpDate.getDate() + 81);               while(vTmpDate.getDate() > 1)                {                  vTmpDate.setDate(vTmpDate.getDate() + 1);               }            }         }         vRightTable += vDateRowStr + '</TR>';         vRightTable += '</TBODY></TABLE>';         // Draw each row         for(i = 0; i < vTaskList.length; i++)         {            vTmpDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());            vTaskStart = vTaskList[i].getStart();            vTaskEnd   = vTaskList[i].getEnd();            vNumCols = 0;            vID = vTaskList[i].getID();            vNumUnits = Math.ceil((vTaskList[i].getEnd() - vTaskList[i].getStart()) / (24 * 60 * 60 * 1000)) + 1;	         if(vTaskList[i].getVisible() == 0)                vRightTable += '<DIV id=childgrid_' + vID + ' style="position:relative; display:none;">';            else		         vRightTable += '<DIV id=childgrid_' + vID + ' style="position:relative">';                        if( vTaskList[i].getMile()) {               vRightTable += '<DIV><TABLE style="position:relative; top:0px; width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +                  '<TR id=childrow_' + vID + ' class=yesdisplay style="HEIGHT: 20px" onMouseover=g.mouseOver(this,' + vID + ',"right","mile") onMouseout=g.mouseOut(this,' + vID + ',"right","mile")>' + vItemRowStr + '</TR></TABLE></DIV>';               // Build date string for Title               vDateRowStr = JSGantt.formatDateStr(vTaskStart,vDateDisplayFormat);               vTaskLeft = (Date.parse(vTaskList[i].getStart()) - Date.parse(vMinDate)) / (24 * 60 * 60 * 1000);               vTaskRight = 1  	            vRightTable +=                  '<div id=bardiv_' + vID + ' style="position:absolute; top:0px; left:' + Math.ceil((vTaskLeft * (vDayWidth) + 1)) + 'px; height: 18px; width:160px; overflow:hidden;">' +                  '  <div id=taskbar_' + vID + ' title="' + vTaskList[i].getName() + ': ' + vDateRowStr + '" style="height: 16px; width:12px; overflow:hidden; cursor: pointer;" onclick=JSGantt.taskLink("' + vTaskList[i].getLink() + '",300,200);>';               if(vTaskList[i].getCompVal() < 100) 		            vRightTable += '&loz;</div>' ;               else 		            vRightTable += '&diams;</div>' ;                        if( g.getCaptionType() ) {                           vCaptionStr = '';                           switch( g.getCaptionType() ) {                                         case 'Caption':    vCaptionStr = vTaskList[i].getCaption();  break;                              case 'Resource':   vCaptionStr = vTaskList[i].getResource();  break;                              case 'Duration':   vCaptionStr = vTaskList[i].getDuration(vFormat);  break;                              case 'Complete':   vCaptionStr = vTaskList[i].getCompStr();  break;		                     }                           //vRightTable += '<div style="FONT-SIZE:12px; position:absolute; left: 6px; top:1px;">' + vCaptionStr + '</div>';                           vRightTable += '<div style="FONT-SIZE:12px; position:absolute; top:2px; width:120px; left:12px">' + vCaptionStr + '</div>';	                  }  	            vRightTable += '</div>';            } else {               // Build date string for Title               vDateRowStr = JSGantt.formatDateStr(vTaskStart,vDateDisplayFormat) + ' - ' + JSGantt.formatDateStr(vTaskEnd,vDateDisplayFormat)               vTaskLeft = (Date.parse(vTaskList[i].getStart()) - Date.parse(vMinDate)) / (24 * 60 * 60 * 1000);               vTaskRight = (Date.parse(vTaskList[i].getEnd()) - Date.parse(vTaskList[i].getStart())) / (24 * 60 * 60 * 1000) + 1/vColUnit;               // Draw Group Bar  which has outer div with inner group div and several small divs to left and right to create angled-end indicators               if( vTaskList[i].getGroup()) {                  vRightTable += '<DIV><TABLE style="position:relative; top:0px; width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +                     '<TR id=childrow_' + vID + ' class=yesdisplay style="HEIGHT: 20px" bgColor=#f3f3f3 onMouseover=g.mouseOver(this,' + vID + ',"right","group") onMouseout=g.mouseOut(this,' + vID + ',"right","group")>' + vItemRowStr + '</TR></TABLE></DIV>';                  var width = Math.ceil((vTaskRight) * (vDayWidth) -1);		  width = width > 5 ? width : 5;		  vRightTable +=                     '<div id=bardiv_' + vID + ' style="position:absolute; top:5px; left:' + Math.ceil(vTaskLeft * (vDayWidth) + 1) + 'px; height: 7px; width:' + Math.ceil((vTaskRight) * (vDayWidth) - 1) + 'px">' +                       '<div id=taskbar_' + vID + ' title="' + vTaskList[i].getName() + ': ' + vDateRowStr + '" class=gtask style="background-color:#000000; height: 7px; width:' + width + 'px;  cursor: pointer;opacity:0.9;">' +                         '<div style="Z-INDEX: -4; float:left; background-color:#666666; height:3px; overflow: hidden; margin-top:1px; ' +                               'margin-left:1px; margin-right:1px; filter: alpha(opacity=80); opacity:0.8; width:' + vTaskList[i].getCompStr() + '; ' +                                'cursor: pointer;" onclick=JSGantt.taskLink("' + vTaskList[i].getLink() + '",300,200);>' +                           '</div>' +			   '</div>';  			if(width > 20 || vFormat == 'day'){			    vRightTable += '<div style="Z-INDEX: -4; float:left; background-color:#000000; height:4px; overflow: hidden; width:1px;"></div>' +			    '<div style="Z-INDEX: -4; float:right; background-color:#000000; height:4px; overflow: hidden; width:1px;"></div>' +			    '<div style="Z-INDEX: -4; float:left; background-color:#000000; height:3px; overflow: hidden; width:1px;"></div>' +			    '<div style="Z-INDEX: -4; float:right; background-color:#000000; height:3px; overflow: hidden; width:1px;"></div>' +			    '<div style="Z-INDEX: -4; float:left; background-color:#000000; height:2px; overflow: hidden; width:1px;"></div>' +			    '<div style="Z-INDEX: -4; float:right; background-color:#000000; height:2px; overflow: hidden; width:1px;"></div>' +			    '<div style="Z-INDEX: -4; float:left; background-color:#000000; height:1px; overflow: hidden; width:1px;"></div>' +			    '<div style="Z-INDEX: -4; float:right; background-color:#000000; height:1px; overflow: hidden; width:1px;"></div>' ; 			}                                                if( g.getCaptionType() ) {                           vCaptionStr = '';                           switch( g.getCaptionType() ) {                                         case 'Caption':    vCaptionStr = vTaskList[i].getCaption();  break;                              case 'Resource':   vCaptionStr = vTaskList[i].getResource();  break;                              case 'Duration':   vCaptionStr = vTaskList[i].getDuration(vFormat);  break;                              case 'Complete':   vCaptionStr = vTaskList[i].getCompStr();  break;		                     }                           //vRightTable += '<div style="FONT-SIZE:12px; position:absolute; left: 6px; top:1px;">' + vCaptionStr + '</div>';                           vRightTable += '<div style="FONT-SIZE:12px; position:absolute; top:-3px; width:120px; left:' + (Math.ceil((vTaskRight) * (vDayWidth) - 1) + 6) + 'px">' + vCaptionStr + '</div>';	                  }                  vRightTable += '</div>' ;               } else {                  vDivStr = '<DIV><TABLE style="position:relative; top:0px; width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +                     '<TR id=childrow_' + vID + ' class=yesdisplay style="HEIGHT: 20px" bgColor=#ffffff onMouseover=g.mouseOver(this,' + vID + ',"right","row") onMouseout=g.mouseOut(this,' + vID + ',"right","row")>' + vItemRowStr + '</TR></TABLE></DIV>';                  vRightTable += vDivStr;                                    // Draw Task Bar  which has outer DIV with enclosed colored bar div, and opaque completion div	            var width = Math.ceil((vTaskRight) * (vDayWidth) - 1);		     width = width > 5 ? width : 5;		     vRightTable +=                     '<div id=bardiv_' + vID + ' style="position:absolute; top:4px; left:' + Math.ceil(vTaskLeft * (vDayWidth) + 1) + 'px; height:18px; width:' + Math.ceil((vTaskRight) * (vDayWidth) - 1) + 'px">' +                        '<div id=taskbar_' + vID + ' title="' + vTaskList[i].getName() + ': ' + vDateRowStr + '" class=gtask style="background-color:#' + vTaskList[i].getColor() +'; height: 13px; width:' + width + 'px; cursor: pointer;opacity:0.9;" ' +                           'onclick=JSGantt.taskLink("' + vTaskList[i].getLink() + '",300,200); >' +                           '<div class=gcomplete style="Z-INDEX: -4; float:left; background-color:black; height:5px; overflow: auto; margin-top:4px; filter: alpha(opacity=40); opacity:0.4; width:' + vTaskList[i].getCompStr() + '; overflow:hidden">' +                           '</div>' +                        '</div>';                        if( g.getCaptionType() ) {                           vCaptionStr = '';                           switch( g.getCaptionType() ) {                                         case 'Caption':    vCaptionStr = vTaskList[i].getCaption();  break;                              case 'Resource':   vCaptionStr = vTaskList[i].getResource();  break;                              case 'Duration':   vCaptionStr = vTaskList[i].getDuration(vFormat);  break;                              case 'Complete':   vCaptionStr = vTaskList[i].getCompStr();  break;		                     }                           //vRightTable += '<div style="FONT-SIZE:12px; position:absolute; left: 6px; top:-3px;">' + vCaptionStr + '</div>';                           vRightTable += '<div style="FONT-SIZE:12px; position:absolute; top:-3px; width:120px; left:' + (Math.ceil((vTaskRight) * (vDayWidth) - 1) + 6) + 'px">' + vCaptionStr + '</div>';	                  }                  vRightTable += '</div>' ;                                 }            }            vRightTable += '</DIV>';         }         vMainTable += vRightTable + '</DIV></TD></TR></TBODY></TABLE></BODY></HTML>';		   vDiv.innerHTML = vMainTable;      }   } //this.draw	this.Clear = function(){   	  vTaskList = [];   }      this.mouseOver = function( pObj, pID, pPos, pType ) {      if( pPos == 'right' )  vID = 'child_' + pID;      else vID = 'childrow_' + pID;            pObj.bgColor = "#ffffaa";      vRowObj = JSGantt.findObj(vID);      if (vRowObj) vRowObj.bgColor = "#ffffaa";   }   this.mouseOut = function( pObj, pID, pPos, pType ) {      if( pPos == 'right' )  vID = 'child_' + pID;      else vID = 'childrow_' + pID;            pObj.bgColor = "#ffffff";      vRowObj = JSGantt.findObj(vID);      if (vRowObj) {         if( pType == "group") {            pObj.bgColor = "#f3f3f3";            vRowObj.bgColor = "#f3f3f3";         } else {            pObj.bgColor = "#ffffff";            vRowObj.bgColor = "#ffffff";         }      }   }} //GanttChart		// Recursively process task tree ... set min, max dates of parent tasks and identfy task level.JSGantt.processRows = function(pList, pID, pRow, pLevel, pOpen){   var vMinDate = new Date();   var vMaxDate = new Date();   var vMinSet  = 0;   var vMaxSet  = 0;   var vList    = pList;   var vLevel   = pLevel;   var i        = 0;   var vNumKid  = 0;   var vCompSum = 0;   var vVisible = pOpen;      for(i = 0; i < pList.length; i++)   {      if(pList[i].getParent() == pID) {         pList[i].setVisible(vVisible);         if(vVisible==1 && pList[i].getOpen() == 0)             vVisible = 0;                     pList[i].setLevel(vLevel);         vNumKid++;         if(pList[i].getGroup() == 1) {            JSGantt.processRows(vList, pList[i].getID(), i, vLevel+1, vVisible);         }         if( vMinSet==0 || pList[i].getStart() < vMinDate) {            vMinDate = pList[i].getStart();            vMinSet = 1;         }         if( vMaxSet==0 || pList[i].getEnd() > vMaxDate) {            vMaxDate = pList[i].getEnd();            vMaxSet = 1;         }         vCompSum += pList[i].getCompVal();      }   }   if(pRow >= 0) {      pList[pRow].setStart(vMinDate);      pList[pRow].setEnd(vMaxDate);      pList[pRow].setNumKid(vNumKid);      pList[pRow].setCompVal(Math.ceil(vCompSum/vNumKid));   }}// Used to determine the minimum date of all tasks and set lower bound based on formatJSGantt.getMinDate = function getMinDate(pList, pFormat)        {         var vDate = new Date();         vDate.setFullYear(pList[0].getStart().getFullYear(), pList[0].getStart().getMonth(), pList[0].getStart().getDate());         // Parse all Task End dates to find min         for(i = 0; i < pList.length; i++)         {            if(Date.parse(pList[i].getStart()) < Date.parse(vDate))               vDate.setFullYear(pList[i].getStart().getFullYear(), pList[i].getStart().getMonth(), pList[i].getStart().getDate());         }         // Adjust min date to specific format boundaries (first of week or first of month)         if (pFormat=='day')         {            vDate.setDate(vDate.getDate() - 1);            while(vDate.getDay() % 7 > 0)            {                vDate.setDate(vDate.getDate() - 1);            }         }         else if (pFormat=='week')         {            vDate.setDate(vDate.getDate() - 7);            while(vDate.getDay() % 7 > 0)            {                vDate.setDate(vDate.getDate() - 1);            }         }         else if (pFormat=='month')         {            while(vDate.getDate() > 1)            {                vDate.setDate(vDate.getDate() - 1);            }         }         else if (pFormat=='quarter')         {            if( vDate.getMonth()==0 || vDate.getMonth()==1 || vDate.getMonth()==2 )               vDate.setFullYear(vDate.getFullYear(), 0, 1);            else if( vDate.getMonth()==3 || vDate.getMonth()==4 || vDate.getMonth()==5 )               vDate.setFullYear(vDate.getFullYear(), 3, 1);            else if( vDate.getMonth()==6 || vDate.getMonth()==7 || vDate.getMonth()==8 )               vDate.setFullYear(vDate.getFullYear(), 6, 1);            else if( vDate.getMonth()==9 || vDate.getMonth()==10 || vDate.getMonth()==11 )               vDate.setFullYear(vDate.getFullYear(), 9, 1);         }         return(vDate);      }      // Used to determine the minimum date of all tasks and set lower bound based on formatJSGantt.getMaxDate = function (pList, pFormat){   var vDate = new Date();         vDate.setFullYear(pList[0].getEnd().getFullYear(), pList[0].getEnd().getMonth(), pList[0].getEnd().getDate());         // Parse all Task End dates to find max         for(i = 0; i < pList.length; i++)         {            if(Date.parse(pList[i].getEnd()) > Date.parse(vDate))               vDate.setFullYear(pList[i].getEnd().getFullYear(), pList[i].getEnd().getMonth(), pList[i].getEnd().getDate());						         }				         // Adjust max date to specific format boundaries (end of week or end of month)         if (pFormat=='day')         {            vDate.setDate(vDate.getDate() + 1);            while(vDate.getDay() % 6 > 0)            {                vDate.setDate(vDate.getDate() + 1);            }         }         if (pFormat=='week')         {            //For weeks, what is the last logical boundary?            vDate.setDate(vDate.getDate() + 11);            while(vDate.getDay() % 6 > 0)            {                vDate.setDate(vDate.getDate() + 1);            }         }         // Set to last day of current Month         if (pFormat=='month')         {            while(vDate.getDay() > 1)            {                vDate.setDate(vDate.getDate() + 1);            }            vDate.setDate(vDate.getDate() - 1);         }         // Set to last day of current Quarter         if (pFormat=='quarter')         {            if( vDate.getMonth()==0 || vDate.getMonth()==1 || vDate.getMonth()==2 )               vDate.setFullYear(vDate.getFullYear(), 2, 31);            else if( vDate.getMonth()==3 || vDate.getMonth()==4 || vDate.getMonth()==5 )               vDate.setFullYear(vDate.getFullYear(), 5, 30);            else if( vDate.getMonth()==6 || vDate.getMonth()==7 || vDate.getMonth()==8 )               vDate.setFullYear(vDate.getFullYear(), 8, 30);            else if( vDate.getMonth()==9 || vDate.getMonth()==10 || vDate.getMonth()==11 )               vDate.setFullYear(vDate.getFullYear(), 11, 31);         }         return(vDate);      }      // This function finds the document id of the specified objectJSGantt.findObj = function (theObj, theDoc)      {         var p, i, foundObj;         if(!theDoc) theDoc = document;         if( (p = theObj.indexOf("?")) > 0 && parent.frames.length){            theDoc = parent.frames[theObj.substring(p+1)].document;            theObj = theObj.substring(0,p);         }         if(!(foundObj = theDoc[theObj]) && theDoc.all)             foundObj = theDoc.all[theObj];         for (i=0; !foundObj && i < theDoc.forms.length; i++)             foundObj = theDoc.forms[i][theObj];         for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)            foundObj = JSGantt.findObj(theObj,theDoc.layers[i].document);         if(!foundObj && document.getElementById)            foundObj = document.getElementById(theObj);         return foundObj;      }JSGantt.changeFormat =      function(pFormat,ganttObj) {        if(ganttObj) 		{		ganttObj.setFormat(pFormat);		ganttObj.DrawDependencies();		}        else           alert('Chart undefined');      }      // Function to open/close and hide/show children of specified taskJSGantt.folder= function (pID,ganttObj) {   var vList = ganttObj.getList();   for(i = 0; i < vList.length; i++)   {      if(vList[i].getID() == pID) {         if( vList[i].getOpen() == 1 ) {            vList[i].setOpen(0);            JSGantt.hide(pID,ganttObj);            if (JSGantt.isIE())                JSGantt.findObj('group_'+pID).innerText = '+';            else               JSGantt.findObj('group_'+pID).textContent = '+';				         } else {            vList[i].setOpen(1);            JSGantt.show(pID, 1, ganttObj);               if (JSGantt.isIE())                   JSGantt.findObj('group_'+pID).innerText = '�';               else                  JSGantt.findObj('group_'+pID).textContent = '�';         }      }   }}JSGantt.hide=     function (pID,ganttObj) {   var vList = ganttObj.getList();   var vID   = 0;   for(var i = 0; i < vList.length; i++)   {      if(vList[i].getParent() == pID) {         vID = vList[i].getID();         JSGantt.findObj('child_' + vID).style.display = "none";         JSGantt.findObj('childgrid_' + vID).style.display = "none";         vList[i].setVisible(0);         if(vList[i].getGroup() == 1)             JSGantt.hide(vID,ganttObj);      }   }}// Function to show children of specified taskJSGantt.show =  function (pID, pTop, ganttObj) {   var vList = ganttObj.getList();   var vID   = 0;   for(var i = 0; i < vList.length; i++)   {      if(vList[i].getParent() == pID) {         vID = vList[i].getID();         if(pTop == 1) {            if (JSGantt.isIE()) { // IE;               if( JSGantt.findObj('group_'+pID).innerText == '+') {                  JSGantt.findObj('child_'+vID).style.display = "";                  JSGantt.findObj('childgrid_'+vID).style.display = "";                  vList[i].setVisible(1);               }            } else {                if( JSGantt.findObj('group_'+pID).textContent == '+') {                  JSGantt.findObj('child_'+vID).style.display = "";                  JSGantt.findObj('childgrid_'+vID).style.display = "";                  vList[i].setVisible(1);               }            }         } else {            if (JSGantt.isIE()) { // IE;               if( JSGantt.findObj('group_'+pID).innerText == '�') {                  JSGantt.findObj('child_'+vID).style.display = "";                  JSGantt.findObj('childgrid_'+vID).style.display = "";                  vList[i].setVisible(1);               }            } else {               if( JSGantt.findObj('group_'+pID).textContent == '�') {                  JSGantt.findObj('child_'+vID).style.display = "";                  JSGantt.findObj('childgrid_'+vID).style.display = "";                  vList[i].setVisible(1);               }            }         }         if(vList[i].getGroup() == 1)             JSGantt.show(vID, 0,ganttObj);      }   }}    // function to open window to display task linkJSGantt.taskLink = function(pRef,pWidth,pHeight)   {	return;    if(pWidth)  vWidth =pWidth;  else vWidth =400;    if(pHeight) vHeight=pHeight; else vHeight=400;    var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);   }JSGantt.parseDateStr = function(pDateStr,pFormatStr) {   var vDate = new Date();	   switch(pFormatStr) {	  case 'mm/dd/yy':	     var vDateParts = pDateStr.split('/');	     if (parseInt(vDateParts[2], 10) < 50)         vDate.setFullYear(parseInt(vDateParts[2], 10)+2000, parseInt(vDateParts[0], 10) - 1, parseInt(vDateParts[1], 10));             else         vDate.setFullYear(parseInt(vDateParts[2], 10)+1900, parseInt(vDateParts[0], 10) - 1, parseInt(vDateParts[1], 10));         return(vDate);	  case 'mm/dd/yyyy':	     var vDateParts = pDateStr.split('/');         vDate.setFullYear(parseInt(vDateParts[2], 10), parseInt(vDateParts[0], 10) - 1, parseInt(vDateParts[1], 10));         return(vDate);	  case 'dd/mm/yy':	     var vDateParts = pDateStr.split('/');	     if (parseInt(vDateParts[2], 10) < 50)         vDate.setFullYear(parseInt(vDateParts[2], 10)+2000, parseInt(vDateParts[1], 10) - 1, parseInt(vDateParts[0], 10));             else         vDate.setFullYear(parseInt(vDateParts[2], 10)+1900, parseInt(vDateParts[1], 10) - 1, parseInt(vDateParts[0], 10));         return(vDate);	  case 'dd/mm/yyyy':	     var vDateParts = pDateStr.split('/');         vDate.setFullYear(parseInt(vDateParts[2], 10), parseInt(vDateParts[1], 10) - 1, parseInt(vDateParts[0], 10));         return(vDate);	  case 'yyyy-mm-dd':	     var vDateParts = pDateStr.split('-');         vDate.setFullYear(parseInt(vDateParts[0], 10), parseInt(vDateParts[1], 10) - 1, parseInt(vDateParts[1], 10));         return(vDate);   }		 }JSGantt.formatDateStr = function(pDate,pFormatStr) {       vYear4Str = pDate.getFullYear() + ''; 	   vYear2Str = vYear4Str.substring(2,4);       vMonthStr = (pDate.getMonth()+1) + '';       vDayStr   = pDate.getDate() + '';      var vDateStr = "";	      switch(pFormatStr) {	        case 'mm/dd/yyyy':               return( vMonthStr + '/' + vDayStr + '/' + vYear4Str );	        case 'dd/mm/yyyy':               return( vDayStr + '/' + vMonthStr + '/' + vYear4Str );	        case 'yyyy-mm-dd':               return( vYear4Str + '-' + vMonthStr + '-' + vDayStr );	        case 'mm/dd/yy':               return( vMonthStr + '/' + vDayStr + '/' + vYear2Str );	        case 'dd/mm/yy':               return( vDayStr + '/' + vMonthStr + '/' + vYear2Str );	        case 'yy-mm-dd':               return( vYear2Str + '-' + vMonthStr + '-' + vDayStr );	        case 'mm/dd':               return( vMonthStr + '/' + vDayStr );	        case 'dd/mm':               return( vDayStr + '/' + vMonthStr );      }		 	  }JSGantt.parseXML = function(ThisFile,pGanttVar){	var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;   // Is this Chrome 		try { //Internet Explorer		try{			xmlDoc=new ActiveXObject("Microsoft.XMLDOM");		}		catch(e){			xmlDoc=new ActiveXObject("msxml2.DOMDocument");		}		}	catch(e) {		try { //Firefox, Mozilla, Opera, Chrome etc. 			if (is_chrome==false) {  xmlDoc=document.implementation.createDocument("","",null); }		}		catch(e) {			alert(e.message);			return;		}	}	if (is_chrome==false) { 	// can't use xmlDoc.load in chrome at the moment		xmlDoc.async=false;		console.log('Gantt Tasks are loading....')		xmlDoc.load(ThisFile);		// we can use  loadxml		console.log('Gantt Tasks are processing....')		JSGantt.AddXMLTask(pGanttVar)		console.log('Gantt Tasks are processed....')		xmlDoc=null;			// a little tidying		this.Task = null;	}	else {		JSGantt.ChromeLoadXML(ThisFile,pGanttVar);			ta=null;	// a little tidying		}}JSGantt.AddXMLTask = function(pGanttVar){	if (xmlDoc == null || xmlDoc === undefined){		console.log('Gantt Docs are NULL....')		return;	}		this.Task=xmlDoc.getElementsByTagName("task");	if (this.Task === undefined){		console.log('Gantt Tasks are NULL....')		return;	}		//var n = xmlDoc.documentElement.childNodes.length;	// the number of tasks. IE gets this right, but mozilla add extra ones (Whitespace)	var n = this.Task.length;	// majid	console.log('Gantt Tasks are ',n)	for(var i=0;i<n;i++) {			// optional parameters may not have an entry (Whitespace from mozilla also returns an error )		// this.Task ID must NOT be zero other wise it will be skipped		try { pID = this.Task[i].getElementsByTagName("pID")[0].childNodes[0].nodeValue;		} catch (error) {pID =0;}		pID *= 1;	// make sure that these are numbers rather than strings in order to make jsgantt.js behave as expected.		if(pID!=0){	 		try { pName = this.Task[i].getElementsByTagName("pName")[0].childNodes[0].nodeValue;			} catch (error) {pName ="No Task Name";}			// If there is no corresponding entry in the XML file the set a default.					try { pColor = this.Task[i].getElementsByTagName("pColor")[0].childNodes[0].nodeValue;			} catch (error) {pColor ="0000ff";}						try { pParent = this.Task[i].getElementsByTagName("pParent")[0].childNodes[0].nodeValue;			} catch (error) {pParent =0;}			pParent *= 1;				try { pStart = this.Task[i].getElementsByTagName("pStart")[0].childNodes[0].nodeValue;			} catch (error) {pStart ="";}			try { pEnd = this.Task[i].getElementsByTagName("pEnd")[0].childNodes[0].nodeValue;			} catch (error) { pEnd ="";}			try { pLink = this.Task[i].getElementsByTagName("pLink")[0].childNodes[0].nodeValue;			} catch (error) { pLink ="";}				try { pMile = this.Task[i].getElementsByTagName("pMile")[0].childNodes[0].nodeValue;			} catch (error) { pMile=0;}			pMile *= 1;			try { pRes = this.Task[i].getElementsByTagName("pRes")[0].childNodes[0].nodeValue;			} catch (error) { pRes ="";}			try { pComp = this.Task[i].getElementsByTagName("pComp")[0].childNodes[0].nodeValue;			} catch (error) {pComp =0;}			pComp *= 1;			try { pGroup = this.Task[i].getElementsByTagName("pGroup")[0].childNodes[0].nodeValue;			} catch (error) {pGroup =0;}			pGroup *= 1;			try { pOpen = this.Task[i].getElementsByTagName("pOpen")[0].childNodes[0].nodeValue;			} catch (error) { pOpen =1;}			pOpen *= 1;			try { pDepend = this.Task[i].getElementsByTagName("pDepend")[0].childNodes[0].nodeValue;			} catch (error) { pDepend =0;}			pDepend *= 1;			if (pDepend==0){pDepend=''} // need this to draw the dependency lines						try { pCaption = this.Task[i].getElementsByTagName("pCaption")[0].childNodes[0].nodeValue;			} catch (error) { pCaption ="";}									// Finally add the task			pGanttVar.AddTaskItem(new JSGantt.TaskItem(pID , pName, pStart, pEnd, pColor,  pLink, pMile, pRes,  pComp, pGroup, pParent, pOpen, pDepend,pCaption));		}	}}JSGantt.ChromeLoadXML = function(ThisFile,pGanttVar){// Thanks to vodobas at mindlence,com for the initial pointers here.	XMLLoader = new XMLHttpRequest();	XMLLoader.onreadystatechange= function(){    JSGantt.ChromeXMLParse(pGanttVar);	};	XMLLoader.open("GET", ThisFile, false);	XMLLoader.send(null);}/* * Commented and rewritten by Khashayar * cause it was a mess. *JSGantt.ChromeXMLParse = function (pGanttVar){// Manually parse the file as it is loads quicker	if (XMLLoader.readyState == 4) {		var ta = XMLLoader.responseText.split(/<task>/gi);		var n = ta.length;	// the number of tasks.		for(var i=1;i<n;i++) {			this.Task = ta[i].replace(/<[/]p/g, '<p');			var te = this.Task.split(/<pid>/i)			if(te.length> 2){var pID=te[1];} else {var pID = 0;}			pID *= 1;			var te = this.Task.split(/<pName>/i)			if(te.length> 2){var pName=te[1];} else {var pName = "No Task Name";}			var te = this.Task.split(/<pstart>/i)			if(te.length> 2){var pStart=te[1];} else {var pStart = "";}			var te = this.Task.split(/<pEnd>/i)			if(te.length> 2){var pEnd=te[1];} else {var pEnd = "";}			var te = this.Task.split(/<pColor>/i)			if(te.length> 2){var pColor=te[1];} else {var pColor = '0000ff';}			var te = this.Task.split(/<pLink>/i)			if(te.length> 2){var pLink=te[1];} else {var pLink = "";}			var te = this.Task.split(/<pMile>/i)			if(te.length> 2){var pMile=te[1];} else {var pMile = 0;}			pMile  *= 1;			var te = this.Task.split(/<pRes>/i)			if(te.length> 2){var pRes=te[1];} else {var pRes = "";}			var te = this.Task.split(/<pComp>/i)			if(te.length> 2){var pComp=te[1];} else {var pComp = 0;}			pComp  *= 1;			var te = this.Task.split(/<pGroup>/i)			if(te.length> 2){var pGroup=te[1];} else {var pGroup = 0;}			pGroup *= 1;			var te = this.Task.split(/<pParent>/i)			if(te.length> 2){var pParent=te[1];} else {var pParent = 0;}			pParent *= 1;			var te = this.Task.split(/<pOpen>/i)			if(te.length> 2){var pOpen=te[1];} else {var pOpen = 1;}			pOpen *= 1;			var te = this.Task.split(/<pDepend>/i)			if(te.length> 2){var pDepend=te[1];} else {var pDepend = "";}			pDepend *= 1;			if (pDepend==0){pDepend=''} // need this to draw the dependency lines			var te = this.Task.split(/<pCaption>/i)			if(te.length> 2){var pCaption=te[1];} else {var pCaption = "";}			// Finally add the task			pGanttVar.AddTaskItem(new JSGantt.TaskItem(pID , pName, pStart, pEnd, pColor,  pLink, pMile, pRes,  pComp, pGroup, pParent, pOpen, pDepend,p 	));		}	}}*/JSGantt.ChromeXMLParse = function (pGanttVar){	// Manually parse the file as it is loads quicker	if (XMLLoader.readyState == 4) {		var dq		= Ext.DomQuery;		var xml		= XMLLoader.responseXML;		var tasks	= dq.select('task', xml);		var pID, pName, pStart, pEnd, pColor, pLink, pMile, pRes,			pComp, pGroup, pParent, pOpen, pDepend, pCaption;		var n = tasks.length;		for (var i = 0; i < n; i++) {			var task = tasks[i];			pID		= dq.selectValue('pID', task, 0);			pName	= dq.selectValue('pName', task, 'No Task Name');			pStart	= dq.selectValue('pStart', task, '');			pEnd	= dq.selectValue('pEnd', task, '');			pColor	= dq.selectValue('pColor', task, '0000FF');			pLink	= dq.selectValue('pLink', task, '');			pMile	= dq.selectValue('pMile', task, 0);			pRes	= dq.selectValue('pRes', task, '');			pComp	= dq.selectValue('pComp', task, 0);			pGroup	= dq.selectValue('pGroup', task, 0);			pParent	= dq.selectValue('pParent', task, 0);			pOpen	= dq.selectValue('pOpen', task, 1);			pDepend	= dq.selectValue('pDepend', task, '');			pCaption= dq.selectValue('pCaption', task, '');			// Finally add the task			pGanttVar.AddTaskItem(				new JSGantt.TaskItem(pID , pName, pStart, pEnd, pColor, pLink, pMile, pRes,  pComp, pGroup, pParent, pOpen, pDepend, pCaption)			);		}	}}JSGantt.benchMark = function(pItem){   var vEndTime=new Date().getTime();   alert(pItem + ': Elapsed time: '+((vEndTime-vBenchTime)/1000)+' seconds.');   vBenchTime=new Date().getTime();}/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/ScrollAccordion.js *//*--------------------------------------------------*/Eve.ScrollAccordion = Ext.extend(Ext.layout.Accordion, {    setItemSize : function(item, size){        if(this.fill && item){            var items = this.container.items.items;            var hh = 0;            for(var i = 0, len = items.length; i < len; i++){                var p = items[i];                if(p != item){                    hh += (p.getSize().height - p.bwrap.getHeight());                }            }			var extra = (item.attachedScroller) ? 28 : 0;            size.height -= hh + extra ;            item.setSize(size);        }    }})Ext.Container.LAYOUTS['scrollaccordion'] = Eve.ScrollAccordion;//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *Ext.ux.collapsedPanelTitlePlugin = function (){	this.init = function(p) {		if (p.collapsible)		{			var r = p.region;			if ((r == 'north') || (r == 'south'))			{				p.on ('render', function()					{						var ct = p.ownerCt;						ct.on ('afterlayout', function()							{								if (ct.layout[r].collapsedEl)								{									p.collapsedTitleEl = ct.layout[r].collapsedEl.createChild ({										tag: 'span',										cls: 'eve-panel-collapse-header',										html: p.title									});									p.setTitle = Ext.Panel.prototype.setTitle.createSequence (function(t)										{p.collapsedTitleEl.dom.innerHTML = t;});								}							}, false, {single:true});						p.on ('collapse', function()							{								if (ct.layout[r].collapsedEl && !p.collapsedTitleEl)								{									p.collapsedTitleEl = ct.layout[r].collapsedEl.createChild ({										tag: 'span',										cls: 'eve-panel-collapse-header',										html: p.title									});									p.setTitle = Ext.Panel.prototype.setTitle.createSequence (function(t)										{p.collapsedTitleEl.dom.innerHTML = t;});								}							}, false, {single:true});					});			}		}	}}/*--------------------------------------------------*//* File: C:\Inetpub\wwwroot\hyperoffice2nd\views\Styles\ModernStyle\javascript/Ext/ux/DateTimePicker.js *//*--------------------------------------------------*/Ext.ns('Ext.ux.form');/*DateTime Picker*/Ext.DateTimePicker = Ext.extend(Ext.DatePicker, {    timeFormat:'g:i A'    ,timeLabel:'Time'    ,timeWidth:100    ,initComponent:function() {        Ext.DateTimePicker.superclass.initComponent.call(this);        this.id = Ext.id();    }    ,onRender: function(container,position){        Ext.DateTimePicker.superclass.onRender.apply(this,arguments);        var table = Ext.get(Ext.DomQuery.selectNode('table tbody',container.dom));        var tfEl = Ext.DomHelper.insertBefore(table.first(),{tag:'tr',            children:[{tag:'td',cls:'x-date-bottom',html:this.timeLabel},{tag:'td',cls:'x-date-bottom ux-timefield', colspan:'2'}]},true);		if (!this.tf) {			this.setValue(new Date())		}        this.tf.render(table.child('td.ux-timefield'));        if (this.getEl().parent('div.x-layer')){            var zindex = this.getEl().parent('div.x-layer').getStyle('z-index');            if(this.tf.list)                this.tf.list.setStyle('z-index',this.getEl().parent('div.x-layer').getStyle('z-index')+ 1000);        }    }    ,setValue : function(value){        var old = this.value;        if (!this.tf){            // create timefield            var timeConfig = Ext.apply({}, {                 id:this.id + '-time'                ,format:this.timeFormat || Ext.form.TimeField.prototype.format                ,width:this.timeWidth                ,fieldLabel:this.timeLabel                ,selectOnFocus:true                ,lazyInit: false            }, this.timeConfig);            this.tf = new Ext.form.TimeField(timeConfig);            this.tf.ownerCt = this;            delete(this.timeFormat);            this.tf.setValue(value);        }        this.value = this.getDateTime(value);    }    ,getDateTime: function(value){        if (this.tf){            var dt = new Date();            var timeval = this.tf.getValue();            value = Date.parseDate(value.format(this.dateFormat) + ' ' +timeval,this.format);        }        return value;    }    ,selectToday : function(){        if(this.todayBtn && !this.todayBtn.disabled){            this.value=this.getDateTime(new Date());            this.fireEvent("select", this, this.value);        }    }});Ext.reg('datetimepickerfield', Ext.DateTimePicker);/*DateTime Item Menu*/Ext.menu.DateTimeItem = function(config){    Ext.menu.DateTimeItem.superclass.constructor.call(this, new Ext.DateTimePicker(config), config);    this.picker = this.component;    this.addEvents('select');    this.picker.on("render", function(picker){        picker.getEl().swallowEvent("click");        picker.container.addClass("x-menu-date-item");    });    this.picker.on("select", this.onSelect, this);};Ext.extend(Ext.menu.DateTimeItem, Ext.menu.Adapter, {    onSelect : function(picker, date){        this.fireEvent("select", this, date, picker);        Ext.menu.DateTimeItem.superclass.handleClick.call(this);    }});/*DateTime Menu*/Ext.menu.DateTimeMenu = function(config){    Ext.menu.DateTimeMenu.superclass.constructor.call(this, config);    this.plain = true;    var di = new Ext.menu.DateTimeItem(config);    this.add(di);    this.picker = di.picker;    this.relayEvents(di, ["select"]);    this.on('beforeshow', function(){        if(this.picker){            this.picker.hideMonthPicker(true);        }    }, this);};Ext.extend(Ext.menu.DateTimeMenu, Ext.menu.Menu, {    cls:'x-date-menu',    beforeDestroy : function() {        this.picker.destroy();    }    ,hide : function(deep){        if (this.picker.tf.innerList){            if ((Ext.EventObject.within(this.picker.tf.innerList)) || (Ext.get(Ext.EventObject.getTarget())==this.picker.tf.innerList))                return false;        }        if(this.el && this.isVisible()){            this.fireEvent("beforehide", this);            if(this.activeItem){                this.activeItem.deactivate();                this.activeItem = null;            }            this.el.hide();            this.hidden = true;            this.fireEvent("hide", this);        }        if(deep === true && this.parentMenu){            this.parentMenu.hide(true);        }    }});/*DateTime Field*/Ext.ux.form.DateTimeField = Ext.extend(Ext.form.DateField, {    dateFormat: 'd-m-Y'    ,timeFormat: 'H:i'    ,defaultAutoCreate : {tag: "input", type: "text", size: "20", autocomplete: "off"}    ,initComponent:function() {        Ext.ux.form.DateTimeField.superclass.initComponent.call(this);        this.format = this.dateFormat + ' ' + this.timeFormat;        this.afterMethod('afterRender',function(){            this.getEl().applyStyles('top:0');        });    }    ,getValue : function(){        return this.parseDate(Ext.form.DateField.superclass.getValue.call(this)) || '';    }    ,onTriggerClick : function(){        if(this.disabled){            return;        }        if(this.menu == null){            this.menu = new Ext.menu.DateTimeMenu();        }        Ext.apply(this.menu.picker,  {            minDate : this.minValue,            maxDate : this.maxValue,            disabledDatesRE : this.ddMatch,            disabledDatesText : this.disabledDatesText,            disabledDays : this.disabledDays,            disabledDaysText : this.disabledDaysText,            format : this.format,            timeFormat: this.timeFormat,            dateFormat: this.dateFormat,            showToday : this.showToday,            minText : String.format(this.minText, this.formatDate(this.minValue)),            maxText : String.format(this.maxText, this.formatDate(this.maxValue))        });        this.menu.on(Ext.apply({}, this.menuListeners, {            scope:this        }));        this.menu.picker.setValue(this.getValue() || new Date());        this.menu.show(this.el, "tl-bl?");    }});Ext.reg('datetimefield', Ext.ux.form.DateTimeField);

