DlTEXTS={goToday:"Go Today",_date_monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],_date_shortMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],_date_dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],_date_shortDayNames:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],_date_firstDayOfWeek:1};try{document.execCommand("BackgroundImageCache",!1,!0)}catch(e){}var CE_CACHE={HTML_ESCAPE_DIV:document.createElement("div"),HTML_ESCAPE_TEXT:document.createTextNode(""),CONTAINER:document.createElement("div")},$__JSOOP=(CE_CACHE.HTML_ESCAPE_DIV.appendChild(CE_CACHE.HTML_ESCAPE_TEXT),Array.$=function(e,n){var i,s,o;null==n&&(n=0);try{i=Array.prototype.slice.call(e,n)}catch(t){for(i=new Array(e.length-n),s=n,o=0;s<e.length;++s,++o)i[o]=e[s]}return i},Object.merge=function(t,e){if(null==t&&(t={}),e)for(var n in e)t[n]=e[n];return t},Object.merge(Object,{mergeDefined:function(t,e){for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t},mergeUndefined:function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},remove:function(t,e){for(var n=e.length;0<=--n;)delete t[e[n]]},isEmpty:function(t){for(var e in t)return!1;return!0},makeCopy:function(t){var e,n={};for(e in t)n[e]=t[e];return n},makeDeepCopy:function(t){if(t instanceof Array){for(var e=[],n=t.length;0<=--n;)e[n]=Object.makeDeepCopy(t[n]);return e}if(null===t)return null;if(!(t instanceof Function)){if(t instanceof Date)return new Date(t);if(t instanceof Object){var i={};for(n in t)i[n]=Object.makeDeepCopy(t[n]);return i}}return t},makeShortcuts:function(t,e){for(var n in e)t[n]=t[e[n]]},foreach:function(t,e,n){for(var i in t)try{e.call(n,t[i],i)}catch(t){if(t===$_BREAK)break;if(t===$_CONTINUE)continue;if(t instanceof $_RETURN)return t.args;throw t}},map:function(t,e,n){var i,s=[];for(i in t)if(Object.HOP(t,i))try{s.push(e.call(n,t[i],i))}catch(t){if(t===$_BREAK)break;if(t===$_CONTINUE)continue;if(t instanceof $_RETURN)return t.args;throw t}return s},grep:function(t,e,n){var i={};if(e instanceof RegExp)for(var s in t)Object.HOP(t,s)&&e.test(s)&&(i[s]=t[s]);else if(e instanceof Function)for(var s in t)Object.HOP(t,s)&&e.call(n,t[s],s)&&(i[s]=t[s]);return i},curry2:function(t){return(t=t instanceof Function?t:this[t]).$A(this,Array.$(arguments,1))},HOP:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},clear:function(t){for(var e in t)Object.HOP(t,e)&&delete t[e]}}),Object.merge(Function,{INHERITANCE:{},getInheritanceGraph:function(){return Function.INHERITANCE},noop:function(){},identity:function(t){return t},returnTrue:function(){return!0},returnFalse:function(){return!1},returnThis:function(){return this},invoke:function(t){return t()}}),new Function.noop);function $_YIELD(t){this.timeout=t||0}Object.merge(Function.prototype,{$:Function.prototype.closure=function(t){var e=Array.$(arguments,1),n=this;return t==window.undefined?function(){return n.apply(this,e.concat(Array.$(arguments)))}:function(){return n.apply(t,e.concat(Array.$(arguments)))}},$0:function(t){var e=this,n=Array.$(arguments,1);return function(){return e.apply(t,n)}},inherits:function(t,e){var n=this.prototype=new t($__JSOOP);return(n.constructor=this).BASE=t.prototype,Function.INHERITANCE[this.name=this._objectType=n._objectType=e||Dynarch.getFunctionName(this)]=Dynarch.getFunctionName(t),this.BASE},setDefaults:function(t,e,n){return Dynarch.setDefaults.call(t,this.DEFAULT_ARGS,e,n)},$$:function(t){return this.$.apply(this,t)},$A:function(t,e){return this.$.apply(this,[t].concat(e))},$C:function(){var t=Array.$(arguments),e=this;return function(){return e.apply(null,t.concat(Array.$(arguments)))}},inverse:function(){var t=this;return function(){return!t.apply(this,arguments)}},clearingTimeout:function(t,e){function n(){i&&clearTimeout(i),i=setTimeout(s.$A(null==e?this:e,o.concat(Array.$(arguments))),t)}var i=null,s=this,o=Array.$(arguments,2);return n.cancel=function(){clearTimeout(i)},n.doItNow=function(){clearTimeout(i),s.apply(e,o.concat(Array.$(arguments)))},n},rarify:function(t,e){function n(){o=t}var i=this.$$(Array.$(arguments,2)),s=this.clearingTimeout.apply(this,Array.$(arguments,1)),o=t,l=null;return function(){return l&&clearTimeout(l),l=setTimeout(n,e),(0<o--?i:s).apply(this,arguments)}},delayed:function(t){var e=1<arguments.length?this.$$(Array.$(arguments,1)):this;return setTimeout(e,t)},setInterval:function(t){var e=1<arguments.length?this.$$(Array.$(arguments,1)):this;return setTimeout(e,0),setInterval(e,t)},inject:function(t){return null==t&&(t=this.OBJECT_EXTENSIONS),Object.merge(this.prototype,t),this},memoize:function(){var t=this,e=$__JSOOP;return function(){return e=e===$__JSOOP?t.apply(this,arguments):e}}}),Object.merge(Array,{hashKeys:function(t){var e,n=[],i=0;for(e in t)t.hasOwnProperty(e)&&(n[i++]=e);return n},hashValues:function(t){var e,n=[],i=0;for(e in t)t.hasOwnProperty(e)&&(n[i++]=t[e]);return n}});var $_BREAK={},$_CONTINUE={};function $_RETURN(t){this.args=t}function $YIELD(t){throw new $_YIELD(t)}function $BREAK(){throw $_BREAK}function $CONTINUE(){throw $_CONTINUE}function $RETURN(t){throw new $_RETURN(t)}function DEFINE_CLASS(n,i,t,e){function s(t){if(t!==$__JSOOP){if(this===window)return alert("FIXME: Constructor called without new in "+n);var e;s.FIXARGS&&(0==arguments.length&&(e=[t={}]),s.FIXARGS.apply(this,e||arguments)),s.DEFAULT_ARGS&&s.setDefaults(this,t),s.BEFORE_BASE&&s.BEFORE_BASE.apply(this,e||arguments),i&&i.apply(this,e||arguments),s.CONSTRUCT&&s.CONSTRUCT.apply(this,e||arguments)}}s.name=n||"",e&&(s.hidden=!0),i&&s.inherits(i,n),n&&!e&&(window[n]=s);e=s.prototype;return t&&(s.DEFINITION=t)(s,e,DynarchDomUtils),e.FINISH_OBJECT_DEF instanceof Function&&e.FINISH_OBJECT_DEF(),e.$||(e.$=Object.curry2),s}function EXTEND_CLASS(t,e){e(t,t.prototype,DynarchDomUtils)}function DEFINE_HIDDEN_CLASS(t,e,n){return DEFINE_CLASS.call(this,t,e,n,!0)}function DEFINE_SINGLETON(t,e,n){e=DEFINE_HIDDEN_CLASS(t,e,n);return DlSingleton.register(t,e,!0),e}function DEFINE_EXCEPTION(t,e){return DEFINE_CLASS(t,e||DlException)}function DlPoint(t,e){"object"==typeof t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e)}function DlRect(t,e,n,i){t instanceof DlRect?this.setFromRect(t):"object"==typeof t?"object"==typeof e?e instanceof DlPoint?this.setFromPoints(t,e):this.setFromValues(t.x,t.y,e.x,e.y):this.setFromValues(t.x,t.y,n,i):this.setFromValues(t,e,n,i)}function DlMenuBase(){var i,e;function n(t,e,n){n=n?n.widget:null;this._noClose||DlPopupMenu.clearAll(),i.applyHooks.delayed(1,i,"onSelect",[this.name,this,n])}this._isMenuBase||(this._isMenuBase=!0,this._items=[],e=(i=this).appendWidget,this.appendWidget=function(t){t instanceof DlMenuItem&&(this._items.push(t),null!=t.name)&&t.addEventListener("onSelect",n),e.apply(this,Array.$(arguments))},this.getItemByName=function(e){return this._items.grep_first(function(t){return t.name&&t.name==e})},this.getItemById=function(e){return this._items.grep_first(function(t){return t.__itemId&&t.__itemId==e})},this instanceof DlHbox?this._popupAlign={prefer:"Br",fallX1:"_r",fallX2:"_l",fallY1:"B_",fallY2:"T_"}:this._popupAlign={prefer:"bR",fallX1:"_R",fallX2:"_L",fallY1:"b_",fallY2:"t_"},this._getDlPopup=function(){var t=this.getParent(DlPopupMenu),e=0;return t&&(e=t._level+1),(e=DlPopupMenu.get(e)).detachPopup(),t&&e.attachToPopup(t),e},this.getToplevelMenu=function(){for(var t=this;t.parentMenu;)t=t.parentMenu;return t})}Array.inject({map_hash:function(e,n,i){return i=i||{},this.foreach(e instanceof Function?function(t){i[t]=e.call(n,t)}:function(t){i[t]=e[t]}),i},accumulate:function(t,e){arguments.length<2&&(e=0);for(var n=0;n<this.length;++n)e=t(this[n],e,n);return e},foreach:function(t,e){null==e&&(e=this);for(var n=0,i=this.length;0<i--;)try{t.call(e,this[n],n++)}catch(t){if(t===$_BREAK)break;if(t===$_CONTINUE)continue;if(t instanceof $_RETURN)return t.args;throw t}},r_foreach:function(t,e){null==e&&(e=this);for(var n=this.length;0<=--n;)try{t.call(e,this[n],n)}catch(t){if(t===$_BREAK)break;if(t===$_CONTINUE)continue;if(t instanceof $_RETURN)return t.args;throw t}},assign_each:function(n,i){return this.foreach(function(t,e){this[e]=n.call(i,e,t)})},r_assign_each:function(n,i){return this.r_foreach(function(t,e){this[e]=n.call(i,e,t)})},toHash:function(n,i){var s={};return n instanceof Function?this.foreach(function(t,e){s[t]=n.call(i,t,e)}):this.foreach(function(t,e){s[t]=null!=n?n:e+1}),s},toHash2:function(){for(var t={},e=0;e<this.length;)t[this[e++]]=this[e++];return t},toHash3:function(n,i){var s={};return n instanceof Function?this.foreach(function(t,e){t=n.call(null!=i?i:t,t,e);s[t[0]]=t[1]}):this.foreach(function(t){s[t[n]]=t}),s},map:function(t,e){var n,i,s=0,o=this.length,l=[];if(t instanceof Function)for(null==e&&(e=this);0<o--;)try{l.push(t.call(e,this[s],s++))}catch(t){if(t===$_BREAK)break;if(t===$_CONTINUE)continue;if(t instanceof $_RETURN){l.push(t.args);break}throw t}else for(n=Array.$(arguments,1);0<o--;)i=(e=this[s])[t],l[s++]=i instanceof Function?i.apply(e,n):i;return l},r_map:function(t,e){var n,i=this.length,s=[];if(t instanceof Function)for(null==e&&(e=this);0<=--i;)try{s.push(t.call(e,this[i],i))}catch(t){if(t===$_BREAK)break;if(t===$_CONTINUE)continue;if(t instanceof $_RETURN){s.push(t.args);break}throw t}else for(var o=Array.$(arguments,1);0<=--i;)n=(e=this[i])[t],s[i]=n instanceof Function?n.apply(e,o):n;return s.reverse()},count:function(n,t){var i=0;return this.r_foreach(function(t,e){n.call(this,t,e)&&++i},t),i},keys_map:function(e){return this.map(function(t){return e[t]})},grep:function(t,e){var n,i,s,o=0,l=this.length,r=[];if(t instanceof RegExp)for(;0<l--;)n=this[o++],t.test(n)&&r.push(n);else if(t instanceof Function)for(null==e&&(e=this);0<l--;)n=this[o],t.call(e,n,o++)&&r.push(n);else for(i=Array.$(arguments,1);0<l--;)(s=(e=this[o++])[t])instanceof Function?s.apply(e,i)&&r.push(e):s&&r.push(e);return r},grep_last:function(t,e){for(null==e&&(e=this.length-1);0<=e;){var n=this[e--];if(t(n))return n}return null},grep_first:function(t,e){for(e=e||0;e<this.length;++e){var n=this[e];if(t(n))return n}return null},contains:function(t){for(var e=this.length;0<=--e;)if(this[e]===t)return!0;return!1},any:function(t,e){if(t instanceof Function){null==e&&(e=this);for(var n=this.length;0<=--n;)if(t.call(e,this[n],n))return!0}else for(var i,s=Array.$(arguments,1),n=this.length;0<=--n;)if((i=(e=this[n])[t])instanceof Function){if(i.apply(e,s))return!0}else if(i)return!0;return!1},remove:function(t){for(var e=this.length;0<=--e;)this[e]===t&&this.splice(e,1);return this},pushUnique:function(t){return this.indexOf(t)<0?(this.push(t),this.length):null},peek:function(t){if(0<this.length)return this[this.length-1-(null!=t?Math.abs(t):0)]},min:function(t,e){if(0==this.length)return null;if(0<arguments.length){for(var n=null!=t?t.call(e,this[0],0):this[0],i=1;i<this.length;++i)n=Math.min(n,null!=t?t.call(e,this[i],i):this[i]);return n}return Math.min.apply(Math,this)},minElement:function(t,e,n){if(0==this.length)return null;for(var i,s=0,o=this[0],l=t.call(e,o),r=0;++s<this.length;)(i=t.call(e,this[s]))<l&&(l=i,o=this[r=s]);return n&&this.splice(r,1),o},max:function(t,e){if(0==this.length)return null;if(0<arguments.length){for(var n=null!=t?t.call(e,this[0],0):this[0],i=1;i<this.length;++i)n=Math.max(n,null!=t?t.call(e,this[i],i):this[i]);return n}return Math.max.apply(Math,this)},maxElement:function(t,e,n){if(0==this.length)return null;for(var i,s=0,o=this[0],l=t.call(e,o),r=0;++s<this.length;)(i=t.call(e,this[s]))>l&&(l=i,o=this[r=s]);return n&&this.splice(r,1),o},rotateIndex:function(t){return Math.rotateLimit(t,0,this.length-1)},limitIndex:function(t){return Math.limit(t,0,this.length-1)},nullLimitIndex:function(t){return Math.nullLimit(t,0,this.length-1)},bytesToString:function(){for(var t,e="",n=0;n<this.length;)240&(t=this[n++])^240?224&t^224?192&t^192||(t=(31&t)<<6|63&this[n++]):t=(15&t)<<12|(63&this[n++])<<6|63&this[n++]:t=(3&t)<<18|(63&this[n++])<<12|(63&this[n++])<<6|63&this[n++],e+=String.fromCharCode(t);return e},repeat:function(t){var e;return 0==t?[]:1==t?this:(e=(e=this.repeat(t>>1)).concat(e),1&t?e.concat(this):e)},common_prefix:function(){switch(this.length){case 0:return"";case 1:return this[0];case 2:for(var t=this[0],e=this[1],n=Math.min(t.length,e.length),i=0;i<n&&t.charAt(i)===e.charAt(i);)++i;return t.substring(0,i);default:return[this[0],this.slice(1).common_prefix()].common_prefix()}},append:function(t){this.push.apply(this,t)},prepend:function(t){this.unshift.apply(this,t)},toXML:function(){var t=this[0];if("~literal"==t)return this.slice(1).flatJoin();var n="<"+t,e=1,i=this[1];for("object"==typeof i&&(Object.foreach(i,function(t,e){"$"==e.charAt(0)&&(e=e.substr(1)),n=(n+=" "+e.htmlEscape()+'="')+("object"==typeof t?Object.map(t,function(t,e){return(e=e.replace(/([a-z]?)([A-Z])/g,function(t,e,n){return e+"-"+n.toLowerCase()})).htmlEscape()+": "+t.htmlEscape()}).join("; "):t.htmlEscape())+'"'}),++e),n+=">";e<this.length;)(i=this[e++])instanceof Array?n+=i.toXML():n+=String(i).htmlEscape();return n+"</"+t+">"},swap:function(t,e){var n=this[t];return this[t]=this[e],this[e]=n,this}}),Number.inject({map:function(t,e){return t+(e-t)*this},reduce:function(t,e){return(this-t)/(e-t)},mapInt:function(t,e){return Math.round(this.map(t,e))},reduceInt:function(t,e){return Math.round((this-t)/(e-t))},bits1Array:function(){for(var t=this,e=[],n=1,i=0;0<t;)1&t&&(e[i++]=n),n<<=1,t>>=1;return e},times:function(t,e){for(var n=this,i=0;0<=--n;)t.call(e,i++,n)},hex:function(t){var e=this.toString(16).toUpperCase();if(t)for(;e.length<t;)e="0"+e;return e},zeroPad:function(t,e){var n=""+Math.round(this);for(null==e&&(e="0");n.length<t;)n=e+n;return n},formatTime:function(){var t=this,e=t/60;return[e/60,e%=60,t%=60].map("zeroPad",2).join(":")},toDate:function(t,e,n,i){return Date.intToDate(this,t,e,n,i)},limit:function(t,e){return Math.limit(this,t,e)},rotateLimit:function(t,e){return Math.rotateLimit(this,t,e)},nullLimit:function(t,e){return Math.nullLimit(this,t,e)},i18n:function(t){var e=this;return t=1<arguments.length?Array.$(arguments):t.trim().split(/\s*\|\s*/),(t=e<t.length?t[e]:t[t.length-1]).replace(/##?/g,function(t){return 2==t.length?"#":e})}}),Object.merge(Math,{nullLimit:function(t,e,n){return t=n<(t=t<e?null:t)?null:t},limit:function(t,e,n){return(t=n<(t=t<e?e:t)?n:t)+0},rotateLimit:function(t,e,n){return(t%=++n-e)<0?t=n+t:t<e&&(t=e-t),t+0}}),Object.merge(Date,{_MD:[31,28,31,30,31,30,31,31,30,31,30,31],SECOND:1e3,MINUTE:6e4,HOUR:36e5,DAY:864e5,WEEK:6048e5,_MN:DlTEXTS._date_monthNames,_SMN:DlTEXTS._date_shortMonthNames,_DN:DlTEXTS._date_dayNames,_SDN:DlTEXTS._date_shortDayNames,_FDOW:DlTEXTS._date_firstDayOfWeek,isWeekend:function(t){return 0==t||6==t},parseMySQL:function(t,e){var t=t.split(/\s+/),n=t[0].split(/-/),t=t[1].split(/:/),i=new Date(n[0],n[1]-1,n[2],t[0]||null,t[1]||null,t[2]||null);return e&&(i.setUTCMilliseconds(0),i.setUTCSeconds(t[2]||0),i.setUTCMinutes(t[1]||0),i.setUTCHours(t[0]||0),i.setUTCDate(1),i.setUTCMonth(n[1]-1),i.setUTCDate(n[2]),i.setUTCFullYear(n[0])),i},dateToInt:function(t){return t instanceof Date?1e4*t.getFullYear()+100*(t.getMonth()+1)+t.getDate():"string"==typeof t?parseInt(t,10):t},intToDate:function(t,e,n,i,s){var o,l;return t instanceof Date||(t=parseInt(t,10),o=Math.floor(t/1e4),t%=1e4,l=Math.floor(t/100),t%=100,t=new Date(o,l-1,t,e||12,n||0,i||0,s||0)),t},getMonthName:function(t,e){return(e?Date._SMN:Date._MN)[t%12]},getFirstDayOfWeek:function(){return Date._FDOW},getDayName:function(t,e){return(e?Date._SDN:Date._DN)[t%7]}}),Date.now||(Date.now=function(){return(new Date).getTime()}),Date.inject({toInt:function(){return Date.dateToInt(this)},getMonthDays:function(t){var e=this.getFullYear();return null==t&&(t=this.getMonth()),0!=e%4||0==e%100&&0!=e%400||1!=t?Date._MD[t]:29},getDayOfYear:function(){var t=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),e=new Date(this.getFullYear(),0,0,0,0,0);return Math.floor((t-e)/Date.DAY)},getWeekNumber:function(){var t=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),e=t.getDay(),e=(t.setDate(t.getDate()-(e+6)%7+3),t.valueOf());return t.setMonth(0),t.setDate(4),Math.round((e-t.valueOf())/6048e5)+1},dateEqualsTo:function(t,e){return this.getFullYear()==t.getFullYear()&&this.getMonth()==t.getMonth()&&(e||this.getDate()==t.getDate())},print:function(t){var e=this.getMonth(),n=this.getDate(),i=this.getFullYear(),s=this.getWeekNumber(),o=this.getDay(),l={},r=this.getHours(),a=12<=r,u=a?r-12:r,h=this.getDayOfYear(),c=(0==u&&(u=12),this.getMinutes()),d=this.getSeconds(),n=(l["%a"]=Date.getDayName(o,!0),l["%A"]=Date.getDayName(o),l["%b"]=Date.getMonthName(e,!0),l["%B"]=Date.getMonthName(e),l["%C"]=1+Math.floor(i/100),l["%d"]=n<10?"0"+n:n,l["%e"]=n,l["%H"]=r<10?"0"+r:r,l["%I"]=u<10?"0"+u:u,l["%j"]=h<100?h<10?"00"+h:"0"+h:h,l["%k"]=r,l["%l"]=u,l["%m"]=e<9?"0"+(1+e):1+e,l["%M"]=c<10?"0"+c:c,l["%n"]="\n",l["%p"]=a?"PM":"AM",l["%P"]=a?"pm":"am",l["%s"]=Math.floor(this.getTime()/1e3),l["%S"]=d<10?"0"+d:d,l["%t"]="\t",l["%U"]=l["%W"]=l["%V"]=s<10?"0"+s:s,l["%u"]=o+1,l["%w"]=o,l["%y"]=(""+i).substr(2,2),l["%Y"]=i,l["%%"]="%",/%./g);return t.replace(n,function(t){return l[t]||t})}}),String.inject({breakable:function(t){return this.replace(t=t||/([_.-])/g,"$1<span class='BreakPoint'> </span>")},printf:function(){var n=Array.$(arguments),i=0;return this.replace(/%[sdfo%]/g,function(t){t=t.charAt(1);var e=n[i++];switch(t){case"s":return e.toString();case"d":return parseInt(e);case"f":return parseFloat(e).toFixed(3);case"o":return e;case"%":return"%"}return"undefined"})},fixedWidth:function(t){return String.buffer("<div style='width:",t,"'>",this,"</div>").get()},noWrap:function(){return this.replace(/\x20/g,"&nbsp;")},lastIndexOfRegexp:function(t,e){var n=0;for(t.lastIndex=0,t.global=!0;t.exec(this)&&!(t.lastIndex>=e);)n=t.lastIndex;return n},hashWords:function(t){return this.trim().split(/\s+/).toHash(!(0<arguments.length)||t)},arrayWords:function(){return this.trim().split(/\s+/)},trim:function(t,e){t=t?this:this.replace(/^\s+/,"");return t=e?t:t.replace(/\s+$/,"")},htmlEscapeFull:function(){return this.replace(/&/g,"&amp;").replace(/\x22/g,"&quot;").replace(/\x27/g,"&#x27;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00A0/g,"&#xa0;")},decodeJSON:function(t){return DlJSON.decode(this,t)},makeLabel:function(){return this.replace(/\s+/g,"&nbsp;")},capitalizeString:function(){return this.charAt(0).toUpperCase()+this.substr(1)},htmlEmbed:function(t,e){var n=["<",t];return null!=e&&n.push(" class='",e,"'"),n.push(">",this,"</",t,">"),n.join("")},repeat:function(t){var e;return 0==t?"":1==t?""+this:(e=this.repeat(t>>1),e+=e,1&t&&(e+=this),e)},hexToBytes:function(t){var e=[],n=0,i=this;for(1&(i=t?i.replace(/[^0-9a-f]/gi,""):i).length&&(i="0"+i);n<i.length;)e.push(parseInt(i.substr(n,2),16)),n++,n++;return e},toBytes:function(){for(var t,e=this.length,n=0,i=0,s=[];0<=--e;)(t=this.charCodeAt(i++))<128?s[n++]=t:t<2048?(s[n++]=192|t>>>6&31,s[n++]=128|63&t):t<65536?(s[n++]=224|t>>>12&15,s[n++]=128|t>>>6&63,s[n++]=128|63&t):t<1114112&&(s[n++]=240|t>>>18&3,s[n++]=128|t>>>12&63,s[n++]=128|t>>>6&63,s[n++]=128|63&t);return s}}),!function(){var t=navigator.userAgent,t=(is_opera=/opera/i.test(t),is_ie=/msie/i.test(t)&&!is_opera&&!/mac_powerpc/i.test(t),is_ie5=is_ie&&/msie 5\.[^5]/i.test(t),is_ie6=is_ie&&/msie 6/i.test(t),is_ie7=is_ie&&/msie 7/i.test(t),is_ie8=is_ie&&/msie 8/i.test(t),ie_box_model=is_ie&&document.compatMode&&"BackCompat"==document.compatMode,is_mac_ie=/msie.*mac/i.test(t),is_khtml=/Konqueror|Safari|KHTML/i.test(t),is_safari=/Safari/i.test(t),is_safari3=is_safari&&/Version\/3/i.test(t),is_konqueror=is_khtml&&!is_safari3,is_gecko=/gecko/i.test(t)&&!is_khtml&&!is_opera&&!is_ie,is_chrome=/Chrome/i.test(t),is_w3=!is_ie,is_macintosh=/Macintosh/i.test(t),is_gecko&&/rv:\s*([0-9.]+)/.test(t)&&(gecko_version=parseFloat(RegExp.$1)),Array.prototype),e=(Date.prototype,String.prototype),n=Number.prototype;function i(n,t){return t?n instanceof Function?function(t,e){return n(e,t)}:function(t,e){return e<t?-1:t<e?1:0}:n instanceof Function?n:function(t,e){return t<e?-1:e<t?1:0}}function s(t){t instanceof Array?t.foreach(s,this):t instanceof Function?null!=(t=t())&&!1!==t&&s.call(this,t):this.push(t)}t.mergeSort=function(t,e){var h;return this.length<2?Array.$(this):(h=i(t,e),function t(e){if(e.length<=1)return e;for(var n=Math.floor(e.length/2),i=e.slice(0,n),e=e.slice(n),i=t(i),e=t(e),s=i,o=e,l=[],r=0,a=0,u=0;r<s.length&&a<o.length;)h(s[r],o[a])<=0?l[u++]=s[r++]:l[u++]=o[a++];return r<s.length&&l.push.apply(l,s.slice(r)),a<o.length&&l.push.apply(l,o.slice(a)),l}(this))},t.qsort=function(t,e){var l,r,a,u;if(!(this.length<2))return l=i(t,e),u=!1,function t(e,n){var i=e,s=n,o=!1;if(i<s){for(;0<l(r[i],r[s])&&(a=r[i],r[i]=r[s],r[s]=a,o=!o,u=!0),o?--s:++i,i<s;);t(e,i-1),t(i+1,n)}}(0,(r=this).length-1),u},t.x=t.repeat,t.flatJoin=function(){return function n(t){{if(t instanceof Array)return t.accumulate(function(t,e){return e+n(t)},"");if(t instanceof Function)return n(t());if(!1===t||null==t)return""}return String(t)}(this)},t.flatten=function(){var t=[];return s.call(t,this),t};n.$1K=1024;var o=n.$1M=1048576,l=n.$1G=1024*o;n.$1T=1024*l;n.formatBytes=function(t){var e,n,i=this;return i<1024?e="B":i<o?(i/=1024,e="K"):i<l?(i/=o,e="M"):i<1099511627776&&(i/=l,e="G"),n=Math.round(i),t&&i!=n?i.toFixed(t)+e:n+e},e.qw=e.arrayWords,e.bold=e.htmlEmbed.$(window.undefined,"b"),e.x=e.repeat}(),Object.merge(String,{firstNonEmpty:function(){for(var t=0;t<arguments.length;++t){var e=arguments[t];if(/\S/.test(e))return e}},template:function(){var format=String.buffer.apply(this,arguments).get();return function(props){return format.replace(/(.?)\$(\{.*?\}|[a-zA-Z0-9_]+)/g,function(s,p1,p2){return"\\"==p1.charAt(0)?s.substr(1):("{"==p2.charAt(0)&&(p2=p2.substr(1,p2.length-2)),eval("p2 = props."+p2),p1+p2)})}},buffer:is_ie||is_khtml?function(){function e(){for(var t=0;t<arguments.length;++t)n[i++]=arguments[t];return e}var n=[],i=0;return e.get=function(){return n=[n.join("")],i=1,n[0]},0<arguments.length&&e.apply(this,arguments),e}:function(){function t(){return e=e.concat.apply(e,arguments),t}var e="";return 0<arguments.length&&t.apply(this,arguments),t.get=function(){return e},t}}),String.prototype.htmlEscape=is_gecko?function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00A0/g,"&#xa0;")}:function(){return CE_CACHE.HTML_ESCAPE_TEXT.data=this,CE_CACHE.HTML_ESCAPE_DIV.innerHTML},window.Dynarch={dblClickTimeout:400,setDefaults:function(t,e,n){var i,s,o;for(i in e=e||{},t)!n&&i in this||(s=(o=t[i])instanceof Array?null!=o[0]&&(s=o[0])in e?e[s]:o[1]:o,this[i]=s)},__IDS:{},ID:function(t){var e=Dynarch.__IDS;return(t=null==t?"generic":t)in e||(e[t]=0),"dynarch-"+t+"-"+ ++e[t]},getFunctionName:function(t){return null!=t.name?t.name:/function\s+(\$?[a-z0-9_]+)\(/i.test(t.toString())?RegExp.$1:"UNKNOWN_FUNCTION"},EXPORT:function(t,e){t=String.buffer("var D=window.",t,"=",t,",P=",t,".prototype;");return e&&t(DynarchDomUtils.importCommonVars()),t.get()},getBaseURL:function(){var t=window.Dynarch_Base_Url;if(!t)for(var e,n=document.getElementsByTagName("script"),i=0;e=n[i++];)if("DynarchLIB"==e.className&&(t=e.src,/^(.*)\x2fjs\x2f/.test(t))){Dynarch_Base_Url=t=RegExp.$1;break}return t},getFileURL:function(t){return Dynarch.getBaseURL()+"/"+t},firebugRunning:function(){return window.console&&window.console.firebug},evalClean:function(code){return Dynarch.firebugRunning()?new Function("return ("+code+");")():eval("("+code+")")}},window.DynarchDomUtils={ID:Dynarch.ID,related:function(t,e){var n,i;if(is_ie?"mouseover"==(i=e.type)?n=e.fromElement:"mouseout"==i&&(n=e.toElement):n=e.relatedTarget,is_gecko&&n)try{n.parentNode}catch(t){try{n=e.parentNode}catch(t){n=e.target}}try{for(;n;n=n.parentNode)if(n===t)return!0}catch(t){return!0}return!1},getScrollbarSize:function(t){return{x:t.offsetWidth-t.clientWidth,y:t.offsetHeight-t.clientHeight}},addEvent:function(t,e,n){if("string"==typeof e)t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n;else if(e instanceof Array)DynarchDomUtils.addEvents(t,e,n);else for(var i in e)DynarchDomUtils.addEvent(t,i,e[i])},addEvents:function(t,e,n){for(var i=e.length;0<=--i;)DynarchDomUtils.addEvent(t,e[i],n)},removeEvent:function(t,e,n){if("string"==typeof e)t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent?t.detachEvent("on"+e,n):t["on"+e]="";else if(e instanceof Array)DynarchDomUtils.removeEvents(t,e,n);else for(var i in e)DynarchDomUtils.removeEvent(t,i,e[i])},removeEvents:function(t,e,n){for(var i=e.length;0<=--i;)DynarchDomUtils.removeEvent(t,e[i],n)},condEvent:function(t){return(t=t?DynarchDomUtils.addEvent:DynarchDomUtils.removeEvent).apply(DynarchDomUtils,Array.$(arguments,1))},condEvents:function(t){return(t=t?DynarchDomUtils.addEvents:DynarchDomUtils.removeEvents).apply(DynarchDomUtils,Array.$(arguments,1))},stopEvent:function(t){return is_ie?(t.cancelBubble=!0,t.returnValue=!1):(t.preventDefault(),t.stopPropagation()),!1},addLoadHandler:function(t,e){is_ie?t.onreadystatechange=function(){if(4==t.readyState){try{t.onreadystatechange=null}catch(t){}e()}}:DynarchDomUtils.addEvent(t,"load",e)},callHandler:function(t,e){return t[e]instanceof Function?t[e].call(t):"string"==typeof t[e]?Dynarch.evalClean(t[e]):void 0},setStyleProperty:function(t,e,n){e="float"===e?"styleFloat":e.toLowerCase().replace(/-([a-z])/g,function(t,e){return e.toUpperCase()}),t.style[e]=n},setOpacity:function(t,e){return null!=e?(""==e&&0!=e?is_ie?t.style.filter="":t.style.opacity="":is_ie?t.style.filter="alpha(opacity="+Math.round(100*e)+")":t.style.opacity=e,e):is_ie?/alpha\(opacity=([0-9.])+\)/.test(t.style.opacity)?parseFloat(RegExp.$1):void 0:parseFloat(t.style.opacity)},getClosestParentByTagName:function(t,e){for(e=e.toLowerCase();t&&t.tagName&&t.tagName.toLowerCase()!=e;)t=t.parentNode;return t},isInside:function(t,e){try{for(;t;){if(t===e)return!0;t=t.parentNode}}catch(t){}return!1},getWindowSize:function(){var t,e;return is_gecko?document.documentElement.clientWidth?{x:document.documentElement.clientWidth,y:document.documentElement.clientHeight}:{x:window.innerWidth,y:window.innerHeight}:is_opera?{x:window.innerWidth,y:window.innerHeight}:is_ie?document.compatMode&&"BackCompat"!=document.compatMode?{x:document.documentElement.clientWidth,y:document.documentElement.clientHeight}:{x:document.body.clientWidth,y:document.body.clientHeight}:((e=(t=document.createElement("div")).style).position="absolute",e.bottom=e.right="0px",document.body.appendChild(t),e={x:t.offsetLeft,y:t.offsetTop},document.body.removeChild(t),e)},getPos:function(t){var e,n;if(t.getBoundingClientRect)return{x:(i=t.getBoundingClientRect()).left-document.documentElement.clientLeft,y:i.top-document.documentElement.clientTop};if(document.getBoxObjectFor){for(var i,s={x:(i=t.ownerDocument.getBoxObjectFor(t)).x,y:i.y};t.parentNode&&t.parentNode!==document.body;)t=t.parentNode,s.x-=t.scrollLeft,s.y-=t.scrollTop;return s}return/^body$/i.test(t.tagName)?{x:0,y:0}:(e=i=0,(n=/^div$/i.test(t.tagName))&&t.scrollLeft&&(i=t.scrollLeft),n&&t.scrollTop&&(e=t.scrollTop),n={x:t.offsetLeft-i,y:t.offsetTop-e},t.offsetParent&&(i=DynarchDomUtils.getPos(t.offsetParent),n.x+=i.x,n.y+=i.y),n)},getBRPos:function(t){var e=DynarchDomUtils.getPos(t),t=DynarchDomUtils.getOuterSize(t);return e.x+=t.x-1,e.y+=t.y-1,e},setPos:function(t,e,n){"number"==typeof e&&(e+="px"),"number"==typeof n&&(n+="px"),null!=e&&(t.style.left=e),null!=n&&(t.style.top=n)},createElement:function(t,e,n,i,s){var o,l=(l=CE_CACHE[t]||(CE_CACHE[t]=document.createElement(t))).cloneNode(!1);if(e)for(o in e)is_ie?DynarchDomUtils.setStyleProperty(l,o,e[o]):l.style.setProperty(o,e[o],"");if(n)for(o in n)l[o]=n[o];return i&&("number"==typeof s&&(s=i.childNodes[s]),i.insertBefore(l,s=s||null)),l},setUnselectable:function(t,e){var n;null==e&&(e=!0),is_ie?(e=e?"on":"off",(n=Array.$(t.getElementsByTagName("*"))).push(t),n.foreach(function(t){t.setAttribute("unselectable",e)})):(e=e?"none":"normal",t.style.MozUserSelect=e,t.style.WebkitUserSelect=e,t.style.userSelect=e)},addClass:function(t,e,n){DynarchDomUtils.delClass(t,n,e)},delClass:function(t,e,n){if(t){var i=t.className;if(e instanceof RegExp&&(i=i.replace(e," "),e=null),n||e){var s=i.split(/\s+/),o=s.length,l={};for(e&&(l[e]=1),n&&(l[n]=1);0<=--o;)s[o]in l&&s.splice(o,1);n&&s.push(n),i=s.join(" ")}t.className=i}},condClass:function(t,e,n,i){DynarchDomUtils[e?"addClass":"delClass"](t,n,i)},hasClass:function(t,e){return t.className.split(" ").contains(e)},elementIsVisible:function(t){return!!t.offsetWidth&&"hidden"!=t.style.visibility},ie_getBackgroundColor:function(t){var e=document.body.createTextRange();return e.moveToElementText(t),"#"+parseInt(e.queryCommandValue("BackColor")).hex(6)},getStyle:function(t,e){var n=null;return window.getComputedStyle?n=document.defaultView.getComputedStyle(t,"").getPropertyValue(e):t.currentStyle&&(n="backgroundColor"==(e=e.replace(/-[a-z]/g,function(t){return t.charAt(1).toUpperCase()}))?ie_getBackgroundColor(t):t.currentStyle[e]),n},getStylePX:function(t,e){t=parseInt(DynarchDomUtils.getStyle(t,e),10);return t=isNaN(t)?0:t},getBorder:function(t){return{x:t.offsetWidth-t.clientWidth,y:t.offsetHeight-t.clientHeight}},getPadding:function(t){var e=DynarchDomUtils.getStylePX;return{x:e(t,"padding-left")+e(t,"padding-right"),y:e(t,"padding-top")+e(t,"padding-bottom")}},getPaddingAndBorder:function(t){var e=0,n=0,i=DynarchDomUtils.getStylePX,e=(e+=i(t,"border-left-width"))+i(t,"border-right-width"),n=(n+=i(t,"border-top-width"))+i(t,"border-bottom-width");return{x:e=(e+=i(t,"padding-left"))+i(t,"padding-right"),y:n=(n+=i(t,"padding-top"))+i(t,"padding-bottom")}},getSelectionRange:function(t){var e,n=is_ie?(0==(n=document.selection.createRange()).compareEndPoints("StartToEnd",n)||n.collapse(!0),e=n.getBookmark().charCodeAt(2)-2,0==(n=document.selection.createRange()).compareEndPoints("StartToEnd",n)||n.collapse(!1),n.getBookmark().charCodeAt(2)-2):(e=t.selectionStart,t.selectionEnd);return{start:e,end:n}},setSelectionRange:function(t,e,n){var i;(n=null==n?e:n)<e&&(i=e,e=n,n=i),"object"==typeof e&&(n=e.end,e=e.start),is_ie?((i=t.createTextRange()).collapse(!0),i.moveStart("character",e),i.moveEnd("character",n-e),i.select()):t.setSelectionRange(e,n)},setOuterSize:function(t,e,n){var i=DynarchDomUtils.getPaddingAndBorder(t);null!=e&&NaN!=i.x&&(e-=i.x),null!=n&&NaN!=i.y&&(n-=i.y),DynarchDomUtils.setInnerSize(t,e,n)},setInnerSize:function(t,e,n){try{"number"==typeof e&&NaN!=e&&(e=Math.abs(e)+"px"),"number"==typeof n&&NaN!=n&&(n=Math.abs(n)+"px"),null==e||NaN==e||is_ie&&e<=0||(t.style.width=e),null==n||NaN==n||is_ie&&n<=0||(t.style.height=n)}catch(t){}},getOuterSize:function(t){return{x:t.offsetWidth,y:t.offsetHeight}},getInnerSize:function(t){var e=DynarchDomUtils.getOuterSize(t),t=DynarchDomUtils.getPaddingAndBorder(t);return e.x-=t.x,e.y-=t.y,e},importCommonVars:function(){return["var DOM=DynarchDomUtils","AC=DOM.addClass","DC=DOM.delClass","CC=DOM.condClass","CE=DOM.createElement","ID=Dynarch.ID"].join(",")},trash:function(t,e){t&&(e=t.parentNode)&&e.removeChild(t)},strip:function(t){for(var e=t.parentNode;t.firstChild;)e.insertBefore(t.firstChild,t);DynarchDomUtils.trash(t)},createFromHtml:function(t){var e=CE_CACHE.CONTAINER;return e.innerHTML=t,e.firstChild},swapNodes:function(t,e){var n=t.parentNode,i=t.nextSibling;e.parentNode.replaceChild(t,e),n.insertBefore(e,i)},scrollIntoView:function(t){for(var e=t.parentNode;e&&(e.scrollHeight==e.clientHeight&&e.scrollWidth==e.clientWidth||/table|tbody/i.test(e.tagName));)e=e.parentNode;if(e&&e!==document.body){for(var n=[],i=e;i;)n.push(i),i=i.parentNode;for(var s=0,o=0,i=t;i&&i!=e;)if(s+=i.offsetTop,o+=i.offsetLeft,i=i.offsetParent,n.contains(i)){i!=e&&(s-=e.offsetTop,o-=e.offsetLeft);break}var l=s+t.offsetHeight,t=o+t.offsetWidth;s<e.scrollTop&&(e.scrollTop=s),s>e.scrollTop&&l>e.scrollTop+e.clientHeight&&(e.scrollTop=l-e.clientHeight),o<e.scrollLeft&&(e.scrollLeft=o),o>e.scrollLeft&&t>e.scrollLeft+e.clientWidth&&(e.scrollLeft=t-e.clientWidth)}},flash:function(t,e,n){n=n||3;var i=setInterval(function(){t.style.visibility=1&n?"hidden":"",--n<0&&clearInterval(i)},e||150)},walk:function(t,e){if(!e(t))for(var n=t.firstChild;n;n=n.nextSibling)1==n.nodeType&&DynarchDomUtils.walk(n,e)},setDocumentTitle:function(t){document.title=t},setZoom:function(e,n){n="scale("+n+")",e=e.style,DynarchDomUtils.forAllStandards("transform",function(t){e.setProperty(t,n,"")})},forAllStandards:function(e,n){["-moz-","-webkit-","-o-","-ms-",""].foreach(function(t){n(t+e)})},CE_CACHE:CE_CACHE},DEFINE_CLASS("DlException",null,function(t,e){t.CONSTRUCT=function(t,e){this.error=this.constructor.name,this.message=this.constructor.name+": "+(t=t||"*** no error message given ***"),null!=e&&(this.code=e)},e.toString=function(){var t=this.message;return this.code&&(t+=" / code: "+this.code),t}}).stopEventBubbling=function(){throw new DlExStopEventBubbling},DEFINE_EXCEPTION("DlExInvalidOperation"),DEFINE_EXCEPTION("DlExAbstractBaseClass"),DEFINE_EXCEPTION("DlExStopEventProcessing"),DEFINE_EXCEPTION("DlExStopFrameEvent"),DEFINE_EXCEPTION("DlExStopEventBubbling"),DEFINE_EXCEPTION("DlDataException"),DEFINE_EXCEPTION("DlSecurityException"),DEFINE_CLASS("DlEventProxy",null,function(t,e){t.CONSTRUCT=function(){this.__eventHooks={},this.__disHooks={},this.registerEvents(this.DEFAULT_EVENTS),this.addEventListener("onDestroy",this.__onDestroy)},e.DEFAULT_EVENTS=["onDestroy"],e.FINISH_OBJECT_DEF=function(){var t=this.constructor.DEFAULT_EVENTS;t&&(this.DEFAULT_EVENTS=this.DEFAULT_EVENTS.concat(t))},e.__onDestroy=function(){["__eventHooks","__disHooks"].foreach(function(t){for(var e in this[t]){var n=this[t][e];n&&n.foreach(function(t,e){this[e]=null}),this[t][e]=null}this[t]=null},this)},e.__getEventHooks=function(t,e){if(this.__eventHooks)return(t=this.__eventHooks[t.toLowerCase()])?e?t.slice(0):t:[];throw new DlExStopEventBubbling},e.registerEvents=function(t){for(var e,n=this.__eventHooks,i=0;e=t[i++];)n[e=e.toLowerCase()]||(n[e]=[])},e.condEventListener=function(t){return(t=t?this.addEventListener:this.removeEventListener).apply(this,Array.$(arguments,1))},e.addEventListener=function(t,e,n,i){if(t instanceof Array)for(var s,o=0;s=t[o++];)this.addEventListener(s,e,n,i);else if("object"==typeof t)for(var o in t)this.addEventListener(o,t[o],e,n);else{var l=this.__getEventHooks(t);l.remove(e),(n=null==n&&"ondestroy"==t.toLowerCase()?!0:n)?l.unshift(e):l.push(e),i&&i.addEventListener("onDestroy",this.removeEventListener.$(this,t,e))}return this},e.listenOnce=function(t,e,n){null==n&&(n=1);function i(){0==--n&&this.removeEventListener(t,i),e.apply(this,arguments)}return this.addEventListener(t,i)},e.connectEvents=function(t,e,n){if("string"==typeof e?(n=e,e=this):n=n||t,t instanceof Array)for(var i=0;i<t.length;++i)this.connectEvents(t[i],e,n[i]);else this.addEventListener(t,function(t,e){return t.applyHooks(e,Array.$(arguments,2))}.$(null,e,n));return this},e.removeEventListener=function(t,e){var n,i=0;if(t instanceof Array)for(;n=t[i++];)this.removeEventListener(n,e);else if("object"==typeof t)for(i in t)this.removeEventListener(i,t[i]);else this.__getEventHooks(t).remove(e);return this},e.removeAllListeners=function(t){if(t instanceof Array)t.foreach(this.removeAllListeners,this);else if("object"==typeof t)for(var e in t)this.removeAllListeners(e);else this.__getEventHooks(t).length=0;return this},e.disableHooks=function(t){return t instanceof Array?t.r_foreach(this.disableHooks,this):(t=t.toLowerCase(),this.__disHooks[t]=this.__eventHooks[t],this.__eventHooks[t]=[]),this},e.enableHooks=function(t){return t instanceof Array?t.r_foreach(this.enableHooks,this):(t=t.toLowerCase(),this.__eventHooks[t]=this.__disHooks[t],this.__disHooks[t]=null),this},e.callHooks=function(t){var e=1<arguments.length?Array.$(arguments,1):[];return this.applyHooks(t,e)},e.hasHooks=function(t){t=this.__eventHooks[t.toLowerCase()];return t&&0<t.length},e.withHooks=function(t,e){this.addEventListener.apply(this,t);try{return e()}finally{this.removeEventListener.apply(this,t)}},e.withDisabledHooks=function(t,e){this.disableHooks.apply(this,t);try{return e()}finally{this.enableHooks.apply(this,t)}},e.applyHooks=function(t,e){var n,i,s=[],o=0;try{for(n=this.__getEventHooks(t,!0);i=n[o++];)s.push(i.apply(this,e))}catch(t){if(!(t instanceof DlExStopEventProcessing))throw t}return s},e.debug_countHooks=function(){var t,e={};for(t in this.__eventHooks)e[t]=this.__eventHooks[t].length;return e},e.invoke=function(t){var e=Array.$(arguments,1);return function(){this[t].apply(this,e.concat(Array.$(arguments)))}.$(this)},e.destroy=function(){this.destroyed||(this.destroying=!0,this.callHooks("onDestroy"),this.__eventHooks=null,this.destroying=!1,this.destroyed=!0)}}),DEFINE_CLASS("DlEvent",null,function(a,t,l){var n=l.createElement,i={mouseover:"onMouseEnter",mouseout:"onMouseLeave",mousedown:"onMouseDown",mouseup:"onMouseUp",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",keydown:"onKeyDown",keyup:"onKeyUp",keypress:"onKeyPress",contextmenu:"onContextMenu",focus:"on_DOM_Focus",blur:"on_DOM_Blur",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",textInput:"onTextInput",paste:"onPaste",copy:"onCopy",cut:"onCut"};function u(t,e,n,i){var s=e.getObject();switch(e.type){case"click":break;case"mousedown":t._ev_mouseDown=!0,t.applyHooks(e.dl_type,[e]);break;case"mouseup":var o=t._ev_mouseDown;t._ev_mouseDown=!1,t.applyHooks(e.dl_type,[e]),o&&t._ev_mouseInside&&0===e.button&&((e=new DlEvent(i)).dl_type="onClick",this.push([t,e,n,i]));break;case"mouseover":case"mouseout":n&&l.related(n,i)?e.dl_type="mouseover"==e.type?"onMouseOver":"onMouseOut":t===s&&(t._ev_mouseInside="mouseover"==e.type),t.applyHooks(e.dl_type,[e]);break;case"dblclick":if((is_ie||is_opera)&&!t.hasHooks("onDblClick")){(e=new DlEvent(i)).type="click",t.applyHooks(e.dl_type="onClick",[e]);break}default:t.applyHooks(e.dl_type,[e])}i&&e.domStop&&l.stopEvent(i)}a.CONSTRUCT=function(e){if(this.type=e.type,this.dl_type=i[this.type]||this.type,this.ctrlKey=e.ctrlKey,this.which=e.which,this.keyIdentifier=e.keyIdentifier,this.key=e.key,is_macintosh?(this.altGrKey=e.altKey,this.altKey=e.metaKey):this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.button=e.button,this.focusedWidget=a.focusedWidget(),is_ie)switch(e.button){case 0:this.button=null;break;case 1:this.button=0;break;case 2:this.button=2;break;case 4:this.button=1}var t;if(0==this.type.indexOf("key")&&(this.keyCode=e.keyCode,this.charCode="which"in e?e.which:is_ie||is_opera?e.keyCode:e.charCode,this.keyStr=String.fromCharCode(this.charCode)),"onMouseWheel"==this.dl_type&&(e.wheelDelta?t=e.wheelDelta/120:e.detail&&(t=-e.detail/3),this.wheelDelta=t),this.pos={x:e.clientX,y:e.clientY},this.relPos=this.pos,is_ie)switch(this.target=e.srcElement,this.type){case"mouseover":this.relatedTarget=e.fromElement;break;case"mouseout":this.relatedTarget=e.toElement}else try{this.target=e.target,3==this.target.nodeType&&(this.target=this.target.parentNode),"mouseout"!=this.type&&"mouseover"!=this.type||(this.relatedTarget=e.relatedTarget,this.relatedTarget&&3==this.relatedTarget.nodeType&&(this.relatedTarget=this.relatedTarget.parentNode))}catch(t){this.relatedTarget=e.explicitOriginalTarget}},t.computePos=function(t){t=t?t instanceof DlWidget?t.getElement():t:document.body,t=this.elPos=t?l.getPos(t):{x:0,y:0};return this.relPos={x:this.pos.x-t.x,y:this.pos.y-t.y,elPos:t}},t.getObject=function(t){var e=this.target,n=this.object;if(!n){try{for(;e&&!DlWidget.getFromElement(e);)e=e.parentNode;n=e?DlWidget.getFromElement(e):null}catch(t){n=null}this.object=n}return n=t?n.getParent(t):n},t.getParentElement=function(t,e){if((e=e&&e instanceof DlWidget?e.getElement():e)&&n===e)return null;var n=this.target;try{for(;n&&n.tagName.toLowerCase()!=t;)if(n=n.parentNode,e&&n===e)return null}catch(t){n=null}return n},a.stopEvent=l.stopEvent;var h=null;function s(){this===h&&(h=null)}a.fakeBlur=function(){if(is_safari&&h.blur)return h.blur();var t,e=l.CE_CACHE.FAKE_FOCUS;(e=e||(l.CE_CACHE.FAKE_FOCUS=n("a",null,{href:"#",innerHTML:".",className:"DYNARCH-FAKE-FOCUS"},document.body))).focus(),is_ie&&((t=document.body.createTextRange()).moveStart("character",0),t.collapse(!0),t.select()),e.blur(),window.status=""},a.focusedWidget=function(t){if(0<arguments.length&&h!==t&&(h&&!h.destroyed&&(2==h._focusable?t._focusable<2&&a.fakeBlur():h.blur(),h.removeEventListener("onDestroy",s)),h=t)){t.addEventListener("onDestroy",s);for(var e=t.parent;e;)e._focusedWidget=t,e=e.parent}return h},a.checkDisabled=function(t){for(;t;){if(t.disabled())return!0;t=t.parent}return!1},t.destroy=function(){this.object=this.target=this.relatedTarget=null},t.stopDomEvent=function(){a.stopEvent(a.latestDomEvent)};var c=a.GLOBAL_CAPTURES={},d="keydown keyup keypress".hashWords(),e=(a._genericEventHandler=function(e,t){var n,i=(e=e||window.event)instanceof a?e:new a(e);if(t&&(e=t),i._failed)a.stopEvent(e);else{a.latestEvent=i,a.latestDomEvent=e,i.pos.x&&"onMouseWheel"!=i.dl_type&&"onMouseDown"==(a.latestMouseEvent=i).dl_type&&(a.latestMouseDownEvent=i);try{var s=c[i.dl_type];if(s)for(r=s.length;0<=--r;)s[r](i);for(var o=(i.type in d&&h?h.getElement():i.target),l=[],r=0;o&&!((n=DlWidget.getFromElement(o))&&(a.checkDisabled(n)||(l[r++]=[n,i,o,e]),n.__noPropEvents)&&n.__noPropEvents.test(i.dl_type));)o=o.parentNode;for(r=0;r<l.length;++r)u.apply(l,l[r])}catch(t){if(!(t instanceof DlExStopEventBubbling))throw t;a.stopEvent(e)}i.destroy()}},[]);function o(){e.r_foreach(Function.invoke)}a._unloadHandler=o,a.captureGlobals=function(t){for(var e in t)a.captureGlobal(e,t[e])},a.releaseGlobals=function(t){for(var e in t)a.releaseGlobal(e,t[e])},a.captureGlobal=function(t,e){(c[t]||(c[t]=[])).push(e)},a.releaseGlobal=function(t,e){t=c[t];t&&t.remove(e)},a.atUnload=function(t){e.push(t)},l.addEvents(document,["contextmenu","click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove",is_gecko?"DOMMouseScroll":"mousewheel","keydown","keyup","keypress","paste","copy","cut"],a._genericEventHandler),l.addEvent(window,"unload",o)}),DEFINE_CLASS("DlWidget",DlEventProxy,function(n,t,s){var o=s.createElement,i=s.addClass,l=s.delClass,r=s.condClass,e=Dynarch.ID,a=(n.FIXARGS=function(t){null==t.focusable&&t.tabIndex&&(t.focusable=!0)},n.CONSTRUCT=function(){if(this.__propsUserData={},this.__refNodes=[],!(null==this._parent||this._parent instanceof DlContainer))throw new DlException("Parent must be an instance of DlContainer");this.id=e(this._objectType||"DlWidget"),(a[this.id]=this).initDOM()},n.DEFAULT_ARGS={userData:["data",null],_parent:["parent",null],_fillParent:["fillParent",null],_tagName:["tagName","div"],_dragArgs:["drag",null],_element:["element",null],_focusable:["focusable",!1],_tabIndex:["tabIndex",0],_accessKey:["accessKey",null],__appendArgs:["appendArgs",window.undefined],__addClassName:["className",""],__disabled:["disabled",!1],__tooltip:["tooltip",null],__contextMenu:["contextMenu",null],__tooltipTimeout:["tooltipTimeout",650],__refCnt:["_refCnt",0],__noPropEvents:["dontBubbleEvents",null]},n.DEFAULT_EVENTS=["onMouseEnter","onMouseLeave","onMouseMove","onMouseDown","onMouseUp","onMouseOver","onMouseOut","onMouseWheel","onClick","onDblClick","onDisabled","onDisplay","onFocus","on_DOM_Focus","onBlur","on_DOM_Blur","onKeyDown","onKeyUp","onKeyPress","onResize","onContextMenu","onTooltipShow","onTooltipHide"],n.WIDGETS={}),u=(n.getById=function(t){return a[t]},n.getFromElement=function(t){return t._dynarch_object},n.getFromUpElement=function(t){for(;t&&!t._dynarch_object;)t=t.parentNode;return t&&t._dynarch_object},null);function h(){return u=u||new DlTooltip({})}n.getTooltip=h,t.getWidgetId=function(){return this.id},t._className=[],t.FINISH_OBJECT_DEF=function(){n.BASE.FINISH_OBJECT_DEF.call(this),this._className=this._className.concat([this._objectType])};var c=null;t.getResizeRect=n.getResizeRect=function(){return c=c||o("div",{display:"none"},{className:"Dl-ResizeRect",innerHTML:"&nbsp;"},document.body)},n.debug_countHooks=function(){var e={};return Array.hashKeys(DlWidget.WIDGETS).foreach(function(t){e[t]=DlWidget.WIDGETS[t].debug_countHooks()}),e},t.destroy=function(){this.unref()<=0&&n.BASE.destroy.call(this)},t.__onTooltipShow=function(){this.__tooltipActive=!0,this.callHooks("onTooltipShow")},t.__onTooltipHide=function(){this.__tooltipActive=!1,this.callHooks("onTooltipHide")};{function d(t,e){var n;t.dragging||(Math.abs(e.pos.x-t.startPos.x)>=t.delta||Math.abs(e.pos.y-t.startPos.y)>=t.delta)&&(t.dragging=!0,t.makeElementCopy(this,e),t.applyHooks("onStartDrag",[this,e]),this.addClass(t.draggingClass)),t.dragging&&((n=t.elementCopy)&&(n.style.left=e.pos.x+5+"px",n.style.top=e.pos.y+5+"px"),t.moving(this,e),DlException.stopEventBubbling())}function _(t,e,n){this.delClass(t.draggingClass),DlEvent.releaseGlobals(t.captures),t.captures=null,v=!1,n||t.doDrop(this,e),t.reset(n)}function f(t,e){var n;0==e.button&&(n=t.dragging&&t.canDrop,_.call(this,t,e,!n))}function p(t,e){DlException.stopEventBubbling()}function g(t,e){DlException.stopEventBubbling()}function m(t,e){for(var n=e.getObject(),i=!1,s=n;s;){if(s===this){i=!0;break}s=s.parent}t.dropOK(this,e,n,i);DlException.stopEventBubbling()}function y(t,e){DlException.stopEventBubbling()}function D(t,e){e.keyCode==DlKeyboard.ESCAPE&&_.call(this,t,e,!0),DlException.stopEventBubbling()}function E(t,e){DlException.stopEventBubbling()}}var v=!(t._popupTooltip=function(){h().popup({timeout:this.__tooltipTimeout,content:this.__tooltip,anchor:this.getElement(),align:"mouse",onPopup:this.__onTooltipShow,onHide:this.__onTooltipHide,widget:this})});t.setData=function(t,e){1==arguments.length?delete this.__propsUserData[t]:this.__propsUserData[t]=e},t.getData=function(t){return this.__propsUserData[t]},t._getDlPopup=function(){var t=(t=this.getParent(DlPopup)||0)&&t._level+1;return DlPopupMenu.get(t)},t._getContextMenuPopup=t._getDlPopup;var C={onDestroy:function(){if(this.__tooltipActive&&h().hide(),this.__contextMenu instanceof n&&this.__contextMenu.destroy(),this.parent)try{this.parent.removeWidget(this)}catch(t){}var t=this.getElement();t&&(t._dynarch_object=null,t._dynarch_focusable=null),this._element=null,s.trash(t),a[this.id]&&(a[this.id]=null,delete a[this.id]),t=null,this.__refNodes.r_foreach(function(t,e){this.__refNodes[e]=null,this[t]=null,delete this[t]},this),this.__refNodes=null,this.userData=null,this.__propsUserData=null},onMouseEnter:function(){this.__tooltip&&this._popupTooltip()},onMouseLeave:function(){h().hide()},onMouseDown:function(t){var e,n;h().cancel(),this._focusable&&!t._justFocusedWidget&&(t._justFocusedWidget=this)._focusable<2&&this.focus(),0==t.button&&(e=this._dragArgs)&&!v&&e.startOK(this,t)&&((n=t.getObject())&&n.applyHooks("onMouseLeave",[t]),v=!0,e.source=this,e.captures={onMouseMove:d.$(this,e),onMouseUp:f.$(this,e),onMouseOver:p.$(this,e),onMouseOut:g.$(this,e),onMouseEnter:m.$(this,e),onMouseLeave:y.$(this,e),onContextMenu:E.$(this,e),onKeyPress:D.$(this,e)},e.startPos=t.pos,e.startElPos=this.getPos(),DlEvent.captureGlobals(e.captures))},onContextMenu:function(t){var e=this.__contextMenu;(e="function"==typeof e?e.call(this,t):e)&&(this._getContextMenuPopup().popup({timeout:0,content:e,anchor:e.contextMenuAnchor||this.getElement(),align:e.contextMenuAlign||"mouse",widget:this,onPopup:e.contextMenuOnPopup||null,onHide:e.contextMenuOnHide||null,isContext:!0}),DlException.stopEventBubbling())}};t._setListeners=function(){this.addEventListener(C),this.addEventListener("onKeyDown",this._handle_focusKeys)},t._handle_focusKeys=function(t){},t._check_accessKey=function(t){return this._accessKey&&DlKeyboard.checkKey(t,this._accessKey)},t._handle_accessKey=function(t){this.focus()},t._setFocusedStyle=function(t){this.condClass(t,this._className.peek()+"-focus")},t.focus=function(){this._focusable?(DlEvent.focusedWidget(this),this._setFocusedStyle(!0),this.callHooks("onFocus"),this instanceof DlEntry||this.scrollIntoView()):this.parent&&this.parent.focus()},t.blur=function(){!this._focusable||this.destroyed||(this._setFocusedStyle(!1),this.callHooks("onBlur"))},t.focusInside=function(){for(var t=DlEvent.focusedWidget();t&&t!=this;)t=t.parent;return!!t},t._createElement=function(t){var e,n,i=this._element;i?this.__alreadyInDom=!0:(n=(e=this.constructor).__joinedClassName||this._className.join(" "),e.__joinedClassName||(e.__joinedClassName=n),this.__addClassName&&(n+=" "+this.__addClassName),t?(i=s.createFromHtml(t)).className=n:i=o(this._tagName,null,{className:n}),this._focusable&&(i._dynarch_focusable=!0),this._element=i),i._dynarch_object=this},t.getElement=function(){return this._element},t.getParentNode=function(){return this._element.parentNode},t.getDOMChildren=function(){return Array.$(this.getContentElement().childNodes)},t.getContentElement=function(){return this.getElement()},t.setStyle=function(t,e){var n=this.getElement().style;if(1<arguments.length)n[t]=e;else for(var i in t)this.setStyle(i,t[i])},t.setContent=function(t){for(var e=this.getContentElement();e.firstChild;)e.removeChild(e.lastChild);if("string"==typeof t)e.innerHTML=t;else{if(t instanceof Function)return this.setContent(t.call(this));t instanceof n?this.appendWidget(t,this.__appendArgs):t instanceof Array?e.innerHTML=t.join(""):null!=t&&e.appendChild(t)}return null!=t},t.ref=function(){return this.__refCnt++},t.unref=function(){return--this.__refCnt},t.refCnt=function(){return this.__refCnt},t.setContextMenu=function(t){this.__contextMenu instanceof n&&this.__contextMenu.destroy(),t instanceof n&&t.ref(),this.__contextMenu=t},t.setTooltip=function(t){this.__tooltip=t},t.initDOM=function(){return this._setListeners(),this._createElement(),this._parent&&(this._parent.appendWidget(this,this.__appendArgs),this._parent=null),this.__disabled&&this.disabled(!0,!0),this.__onTooltipShow=this.__onTooltipShow.$(this),this.__onTooltipHide=this.__onTooltipHide.$(this),this},t.setUnselectable=function(t,e){null==t&&(t=this.getElement()),s.setUnselectable(t,e)},t.disabled=function(t,e){return null==t||!e&&t==this.__disabled||(this.__disabled=t,this.condClass(t,"DlWidget-disabled"),this.condClass(t,this._className.peek()+"-disabled"),this.applyHooks("onDisabled",[t])),this.__disabled},t.enabled=function(t,e){return null!=t&&this.disabled(!t,e),!this.__disabled},t.getParent=function(t,e){if(null==t)return this.parent;var n=this;for(e&&(n=this.parent);n&&!(n instanceof t);)n=n.parent;return n},t.findParent=function(t,e){var n,i=this;if(e&&(i=this.parent),t instanceof Function)for(;i&&!t(i);)i=i.parent;else for(var s=Array.$(arguments,2);i;){if(n=i[t]){if(!(n instanceof Function))break;if(n.apply(i,s))break}i=i.parent}return i},t.getPos=function(){return s.getPos(this.getElement())},t.getBRPos=function(){return s.getBRPos(this.getElement())},t.getOffsetPos=function(){var t=this.getElement();return{x:t.offsetLeft,y:t.offsetTop}},t.setPos=function(t,e){var n=this.getElement();null!=t&&"object"==typeof t&&(e=t.y,t=t.x),null!=t&&(n.style.left=t+"px"),null!=e&&(n.style.top=e+"px")},t.setSize=t.setOuterSize=function(t){s.setOuterSize(this.getElement(),t.x,t.y),this.callHooks("onResize")},t.setInnerSize=function(t){s.setInnerSize(this.getContentElement(),t.x,t.y),this.callHooks("onResize")},t.getSize=t.getOuterSize=function(){return s.getOuterSize(this.getElement())},t.getInnerSize=function(){return s.getInnerSize(this.getContentElement())},t.display=function(t){var e=this.getElement().style;return null!=t?(e.display=t?"":"none",this.applyHooks("onDisplay",[t,e.display,"display"]),t):"none"!=e.display},t.visibility=function(t){var e=this.getElement().style;return null!=t?(e.visibility=t?"":"hidden",this.applyHooks("onDisplay",[t,e.visibility,"visibility"]),t):"hidden"!=e.visible},t.opacity=function(t){return s.setOpacity(this.getElement(),t)},t.position=function(t){var e=this.getElement().style,n=e.position;return null!=t&&(e.position=t),n},t.setIconClass=function(t){var e=this.getContentElement();r(e,null!=t,this.__withIconClass||this._className.peek()+"-withIcon"),this.iconClass&&l(e,this.iconClass),t&&i(e,t),this.iconClass=t},t.addClass=function(t,e){i(this.getElement(),t,e)},t.delClass=function(t,e){l(this.getElement(),t,e)},t.condClass=function(t,e,n){return r(this.getElement(),t,e,n),t},t.zIndex=function(t){var e=this.getElement();return null!=t?e.style.zIndex=t:e.style.zIndex?parseInt(e.style.zIndex,10):0},t.refNode=function(t,e){return this[t]=e,this.__refNodes.remove(t),null!=e&&this.__refNodes.push(t),e},t.debug_highlight=function(t){this.getElement().style.backgroundColor=t||"yellow"},t.getQuickPopup=function(){var t=(t=this.getParent(DlPopup)||0)&&t._level+1;return DlDialogPopup.get(t)},t.quickPopup=function(t){var e=this.getQuickPopup();t=Object.makeCopy(t),Object.mergeUndefined(t,{anchor:this.getElement(),align:{prefer:"CC"}}),e.popup(t)},t.getScroll=function(){var t=this.getElement();return{x:t.scrollLeft,y:t.scrollTop}},t.scrollIntoView=function(){s.scrollIntoView(this.getElement())},t.flash=function(t,e){s.flash(this.getElement(),t,e)}}),DEFINE_CLASS("DlContainer",DlWidget,function(i,t){function s(t,e){return t=t?Array.$(t.getElement().getElementsByTagName("*")):[],Array.$(this.getElement().getElementsByTagName("*")).grep(e?"_dynarch_object":"_dynarch_focusable").grep(DynarchDomUtils.elementIsVisible).grep(t.contains.$(t).inverse()).map(DlWidget.getFromElement).grep("enabled").mergeSort(function(t,e){return t._tabIndex-e._tabIndex})}function e(t,e){var n=s.call(this,t),t=n.indexOf(t);if(null!=(t=n.rotateIndex(t+e)))return n[t]}var n;i.BEFORE_BASE=function(){this._widgets=[]},i.DEFAULT_ARGS={_scrollBars:["scroll",!1],__noParentKeyBindings:["noParentKB",!1]},t._createElement=function(){i.BASE._createElement.apply(this,arguments),this._scrollBars&&this.setStyle("overflow","auto")},t.appendWidget=function(t){t.parent&&t.parent.removeWidget(t),this._widgets.push(t),t.parent=this,t.__alreadyInDom||this._appendWidgetElement.apply(this,arguments),delete t.__alreadyInDom},t._appendWidgetElement=function(e,t){e=e.getElement();if("number"==typeof t){var n=this.getContentElement();try{t=n.childNodes[t],n.insertBefore(e,t)}catch(t){n.appendChild(e)}}else null==t?t=this.getContentElement():"string"==typeof t&&(t=document.getElementById(t)),e.parentNode!==t&&t.appendChild(e)},t.removeWidget=function(t){t.parent===this&&(this._removeWidgetElement(t),this._widgets.remove(t),t.parent=null)},t._removeWidgetElement=function(t){this._widgets.contains(t)&&(t=t.getElement()).parentNode&&t.parentNode.removeChild(t)},t.destroyChildWidgets=function(){for(var t=Array.$(this._widgets),e=0;e<t.length;++e)t[e]instanceof i&&t.push.apply(t,t[e]._widgets);t.r_foreach(function(t){try{t.destroy()}catch(t){}});var n=this.getContentElement();return n&&(n.innerHTML=""),n},t._setListeners=function(){i.BASE._setListeners.call(this),this.addEventListener("onDestroy",this.destroyChildWidgets),this.addEventListener("onResize",this.__doLayout)},t.disabled=function(e,n){var t=i.BASE.disabled.call(this,e,n);return null!=e&&this._widgets.r_foreach(function(t){t.disabled(e,n)}),t},t.children=function(t){return null!=t?this._widgets[t]:this._widgets},t.replaceWidget=function(t,e){var n,i=this._widgets.indexOf(t);0<=i&&(e.parent&&e.parent.removeWidget(e),this._widgets.splice(i,1,e),e._dllayout_args=t._dllayout_args,t._dllayout_args=null,(n=(i=t.getElement()).parentNode).insertBefore(e.getElement(),i),n.removeChild(i),e.parent=this,t.parent=null)},t.__doLayout=function(){var t=this.children().grep_first(function(t){return t._fillParent});t&&t.setSize(this.getInnerSize())},t.getNextFocusWidget=function(t){return e.call(this,t,1)},t.getPrevFocusWidget=function(t){return e.call(this,t,-1)},t.getFirstFocusWidget=function(){return this.getNextFocusWidget(null)},t.getLastFocusWidget=function(){return this.getPrevFocusWidget(null)},t._handleKeybinding=function(e,t){(e.altKey||e.ctrlKey)&&(s.call(this,t,!0).foreach(function(t){if(t._check_accessKey(e))throw t._handle_accessKey(e),e.domStop=!0,new DlExStopEventBubbling}),this.parent)&&!this.__noParentKeyBindings&&this.parent._handleKeybinding(e,this)},i.getHiddenContainer=function(){return n||(n=new this({className:"DlContainer-Hidden"}),document.body.appendChild(n.getElement())),n}}),DEFINE_CLASS("DlRadioGroup",DlEventProxy,function(t,e){t.CONSTRUCT=function(t){null!=t&&(this._maxChecked=1,this._minChecked=null,this.id=t,this.reset(),this.addEventListener("onDestroy",i))};var n={};function i(){n[this.id]&&(this._buttons=null,this._buttonsById=null,this._buttonsByValue=null,this._history=null,delete n[this.id])}function s(t){if(null!=t)if(this._changed=!0,t.checked()){if(null!=this._maxChecked)for(;this._history.length>=this._maxChecked;)this._history[0].checked(!1,!0),this._history.splice(0,1);this._history.push(t)}else{if(null!=this._minChecked&&this._history.length<=this._minChecked)throw t.checked(!0,!0),new DlExStopEventProcessing;this._history.remove(t)}}t.DEFAULT_EVENTS=["onChange"],t.getById=t.get=function(t){return t=t||Dynarch.ID("group"),n[t]||(n[t]=new this(t))},e.reset=function(){this._buttons&&this._buttons.r_foreach(function(t){t.__group=t.__groupId=null}),this._changed=!1,this._buttons=[],this._buttonsById={},this._buttonsByValue={},this._history=[],this.removeAllListeners("onChange"),this.addEventListener("onChange",s)},e.changed=function(t){var e=this._changed;return null!=t&&(this._changed=t),e},e.getSelected=function(){return this._history},e.getButtons=function(){return this._buttons},e.getNextButton=function(t){null==t&&(t=this.getSelected()[0]);var e=this._buttons,t=e.nullLimitIndex(e.indexOf(t)+1);if(null!=t)return e[t]},e.getPrevButton=function(t){null==t&&(t=this.getSelected()[0]);var e=this._buttons,t=e.nullLimitIndex(e.indexOf(t)-1);if(null!=t)return e[t]},e.getValue=function(){return this._history.map("value")},e.setValue=function(t,e){var n,i=this._buttonsByValue;for(n in t=(t=t instanceof Array?t:[t]).toHash(!0),this._history=[],i)i[n].checked(t[n],!0),t[n]&&this._history.push(i[n]);e&&this.callHooks("onChange")},e.getByValue=function(t){return this._buttonsByValue[t]},e.addWidget=function(t,e){this._buttonsById[t.id]||(null==e&&(e=this._buttons.length),this._buttonsById[t.id]=t,this._buttons.splice(e,0,t),t.checked()&&this._history.push(t),void 0!==(e=t.value())&&(this._buttonsByValue[e]=t),t.addEventListener("onDestroy",this.removeWidget.$(this,t)))},e.removeWidget=function(t){this._buttonsById[t.id]&&(this._changed=!0,delete this._buttonsById[t.id],void 0!==t.value()&&delete this._buttonsByValue[t.value()],this._buttons.remove(t),this._history.length!=this._history.remove(t).length)&&this.callHooks("onChange")},e.minChecked=function(t){return 0<arguments.length&&(this._minChecked=t),this._minChecked},e.maxChecked=function(t){return 0<arguments.length&&(this._maxChecked=t),this._maxChecked},e.checkAll=function(e,n){null==e&&(e=!0),null==n&&(n=!1),this._buttons.foreach(function(t){t.checked(e,!n)}),this._history=e?Array.$(this._buttons):[]},e.unCheckAll=function(){this._history.r_foreach(function(t){t.checked(!1)})}}),DEFINE_CLASS("DlAbstractButton",DlWidget,function(n,t){var e=["onMouseEnter","onMouseLeave","onMouseDown","onMouseUp","onUpdateLabel","onClick","onCheck","onChange","onDisabled"],i={STANDARD:1,TWOSTATE:2};n.DEFAULT_ARGS={_label:["label",""],_classes:["classes",{}],_checked:["checked",!1],__groupId:["group",null],_btnType:["type",i.STANDARD],_value:["value",window.undefined],_noCapture:["noCapture",!1],_alwaysCheck:["alwaysCheck",!1]},n.CONSTRUCT=function(t){var e,n=this.__groupId;null!=n&&("object"==typeof n?this.__groupId=(e=n).id:e=DlRadioGroup.get(n),(this.__group=e).addWidget(this,"number"==typeof t.appendArgs?t.appendArgs:null)),this._noCapture||(this._btnpressCapture={onMouseMove:DlException.stopEventBubbling,onMouseUp:this._cap_onMouseUp.$(this),onMouseOver:DlException.stopEventBubbling,onMouseOut:DlException.stopEventBubbling,onMouseEnter:this._cap_onMouseEnter.$(this),onMouseLeave:this._cap_onMouseLeave.$(this)})},n.DEFAULT_EVENTS=["onCheck","onUncheck","onChange","onUpdateLabel"],t._cap_onMouseUp=function(t){var e=t.getObject();DlEvent.releaseGlobals(this._btnpressCapture),this.applyHooks("onMouseUp",[t]),this._ev_mouseInside||this.applyHooks("onMouseLeave",[t]),e!==this&&(e&&e.applyHooks("onMouseEnter",[t]),DlException.stopEventBubbling())},t._cap_onMouseEnter=function(t){t=t.getObject();t===this&&this.addClass(this._classes.active),t&&(t._ev_mouseInside=!0),DlException.stopEventBubbling()},t._cap_onMouseLeave=function(t){t=t.getObject();t===this&&this.delClass(this._classes.active),t&&(t._ev_mouseInside=!1),DlException.stopEventBubbling()},n.TYPE=i,t._onMouseEnter=function(t){this.addClass(this._classes.hover)},t._onMouseLeave=function(t){this.delClass(this._classes.hover),this.delClass(this._classes.active)},t._onMouseDown=function(t){0===t.button&&(this._ev_mouseInside=!0,this.addClass(this._classes.hover),this.addClass(this._classes.active),this._noCapture||(DlEvent.captureGlobals(this._btnpressCapture),t.domStop=!0))},t._onMouseUp=function(t){this.delClass(this._classes.active)},t._onUpdateLabel=function(){this.condClass(!this._label||!/\S/.test(this._label),this._classes.empty)},t._onClick=function(){this._btnType==i.TWOSTATE&&(this._alwaysCheck?this.checked(!0):this.toggle())},t.keyClicked=function(t){this.addClass(this._classes.active),function(){this.delClass(this._classes.hover),this.delClass(this._classes.active),this.applyHooks("onClick",[t])}.delayed(90,this),t&&(t.domStop=!0,DlException.stopEventBubbling())},t._handle_focusKeys=function(t){var e=t.keyCode;e==DlKeyboard.ENTER||t.charCode==DlKeyboard.SPACE?this.keyClicked(t):!this._customMoveKeys&&this.__group&&e in DlKeyboard.KEYS_MOVE&&(e=e in DlKeyboard.KEYS_MOVE_PREV?this.__group.getPrevButton(this):this.__group.getNextButton(this))&&(e.focus(),t.shiftKey&&(this.checked(!0),e.checked(!0)),t.domStop=!0,DlException.stopEventBubbling()),n.BASE._handle_focusKeys.call(this,t)},t._handle_accessKey=function(t){this.focus(),this.keyClicked(t)},t.disabled=function(t,e){return null!=t&&t&&(this.delClass(this._classes.hover),this.delClass(this._classes.active)),n.BASE.disabled.call(this,t,e)},t._onChange=function(){null!=this.__group&&this.__group.applyHooks("onChange",[this])},t._onCheck=Function.noop,t._onDisabled=function(t){this.condClass(t,this._classes.disabled),t&&this._capture&&(DlEvent.releaseCapture(this._capture),this._capture=null)},t._createElement=function(){n.BASE._createElement.call(this),this._createLabelElement(),this.label(this._label,!0),this._updateState(),this.setUnselectable()},t._setListeners=function(){n.BASE._setListeners.call(this),e.r_foreach(function(t){this.addEventListener(t,this["_"+t])},this)},t._createLabelElement=Function.noop,t.label=function(t,e){return(e||0<arguments.length&&t!==this._label)&&(t=(this._label=t)&&"<div class='DlButton-Label'>"+this._label+"</div>",this.setContent(t),this.applyHooks("onUpdateLabel",[this._label])),this._label},t.setLabel=t.label,t.getLabel=t.label,t.group=function(){return this.__group},t._checkTwoState=function(t){var e=this._btnType!=i.TWOSTATE;if(e&&!t)throw new DlExInvalidOperation("This operation is only available for a TWOSTATE button");return!e},t._updateState=function(){var t;this._checkTwoState(!0)&&(t=this._classes,this.condClass(this._checked,t.checked,t.unchecked))},t.checked=function(t,e){return this._checkTwoState(),0<arguments.length&&(t=!!t,e=!e&&this._checked!==t,this._checked=t,this._updateState(),e)&&(this.callHooks("onChange"),this.callHooks(t?"onCheck":"onUncheck")),this._checked},t.toggle=function(t){this._checkTwoState(),this.checked(!this._checked,t)},t.value=function(t){var e=this._value;return 0<arguments.length&&(this._value=t),e},t.setValue=t.value,t.getValue=t.value}),DEFINE_CLASS("DlAnimation",DlEventProxy,function(t,e){t.DEFAULT_EVENTS=["onStart","onStop","onPause","onUpdate"],t.CONSTRUCT=function(t,e){this.addEventListener("onDestroy",this.stop.$(this)),null!=t&&(this.length=t),null!=e&&(this._speed=1e3/e),this._update=function(){this.t=this.i/this.length;try{this.applyHooks("onUpdate",[this.t]),++this.i>this.length&&this.stop(!0)}catch(t){throw this.stop(),t}}.$(this)},e.start=function(t,e,n){this.stop(),null!=t&&(this.length=t),null!=e&&(this._speed=1e3/e),null!=n&&(n instanceof Function||(n=DlAnimation.easing[n]),this.func=n),this.t=0,this.i=0,this.callHooks("onStart"),this._timer=setInterval(this._update,this._speed)},e.running=function(){return this._timer},e.stop=function(t){this._timer&&(clearInterval(this._timer),this._timer=null,this.applyHooks("onStop",[t]))},e.getPos=function(t){return(t=null==t?this.func:t).call(this,this.t)};var i=Math.PI,s=(Math.abs,Math.asin,Math.pow),n=Math.sin,o=Math.cos,l=Math.exp;Math.round,t.easing={elastic_b:function(t){return 1-o(5.5*-t*i)/s(2,7*t)},elastic_b_custom:function(t,e,n){return 1-o(-n*(t+=.5)*i)/s(2,e*n)},magnetic:function(t){return 1-o(t*t*t*10.5*i)/l(4*t)},accel_b:function(t){return 1-(t=1-t)*t*t},accel_a:function(t){return t*t*t},accel_ab:function(t){return 1-n((t=1-t)*t*t*i/2)},bounce_b:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},shake:function(t){return t<.5?-o(11*t*i)*t*t:o(11*(t=1-t)*i)*t*t}}}),DEFINE_CLASS("DlBox",DlContainer,function(e,t,i){e.DEFAULT_ARGS={_borderSpacing:["borderSpacing",0],_align:["align",null],_tagName:["tagName","table"]},t._createElement=function(){e.BASE._createElement.call(this);var t=this.getElement();t.cellSpacing=this._borderSpacing,t.cellPadding=0,this._align&&(t.align=this._align),this.refNode("_tbody",i.createElement("tbody",null,null,t))},t.getTableElement=t.getElement,t._appendWidgetElement=function(t,e){(null==e?this.createCellElement():e).appendChild(t.getElement())},t.destroyChildWidgets=function(){Array.$(this._widgets).r_foreach(function(t){try{t.destroy()}catch(t){}})},t.__addSep=function(t,e,n){(n=n||this.createCellElement()).separator=!0;t=this._objectType+"-"+t;return e&&(t+=" "+e),n.className=t,n.innerHTML="<div class='"+t+"'>&nbsp;</div>",i.setUnselectable(n),n},t.addSeparator=function(t,e){return this.__addSep("separator",t,e)},t.addSpace=function(t,e){return this.__addSep("spacer",t,e)}}),DEFINE_CLASS("DlButton",DlAbstractButton,function(t,e,n){t.CONSTRUCT=function(){this.setIconClass(this._iconClass),this._iconClass=null},t.TYPE=DlAbstractButton.TYPE,t.DEFAULT_ARGS={_classes:["classes",{active:"DlButton-active",hover:"DlButton-hover",checked:"DlButton-1",unchecked:"DlButton-0",empty:"DlButton-empty",disabled:"DlButton-disabled"}],_iconClass:["iconClass",null]},e.__withIconClass="DlButton-withIcon",e._createElement=function(){t.BASE._createElement.call(this),this.addClass("DlWidget-3D")},e._createLabelElement=function(){this.getElement().innerHTML="<div class='DlButton-inner'><div></div></div>"},e.getContentElement=function(){return this.getElement().firstChild.firstChild},e.setSize=e.setOuterSize=function(t){var e=n.getPaddingAndBorder(this.getElement());null!=t.x&&(t.x-=e.x),null!=t.y&&(t.y-=e.y),e=n.getPaddingAndBorder(this.getElement().firstChild),null!=t.x&&(t.x-=e.x),null!=t.y&&(t.y-=e.y),n.setOuterSize(this.getContentElement(),t.x,t.y)}}),DEFINE_CLASS("DlHbox",DlBox,function(t,e,n){var i=n.createElement;e._createElement=function(){t.BASE._createElement.call(this),this.refNode("_row",i("tr",null,null,this._tbody))},e.createCellElement=function(t){var e=i("td",null,{className:"cell"});return null!=t?this._row.insertBefore(e,t):this._row.appendChild(e),e},e._removeWidgetElement=function(t){this._widgets.contains(t)&&(t=t.getElement()).parentNode.parentNode.removeChild(t.parentNode)},e.addFiller=function(){this.createCellElement().className+=" DlHbox-filler",this.addClass("DlHbox-hasFiller")},e.setAlign=function(t,e){var n=this.getElement();switch(t){case"left":n.style.marginLeft="0",n.style.marginRight="auto";break;case"center":n.style.marginLeft="auto",n.style.marginRight="auto";break;case"right":n.style.marginLeft="auto",n.style.marginRight="0";break;default:n.style.marginLeft=null!=t?t:"auto",n.style.marginRight=null!=e?e:"auto"}},e.setEqualWidths=function(t){var e=this.children().max(function(t){return t.getSize().x});t&&(e+=t),this.children().r_foreach(function(t){t.setSize({x:e})})}}),DlPoint.prototype={clone:function(){return new DlPoint(this.x,this.y)},normalize:function(t){var e;return this.x>t.x&&(e=this.x,this.x=t.x,t.x=e),this.y>t.y&&(e=this.y,this.y=t.y,t.y=e),this},distanceTo:function(t){var e=Math.abs(t.x-this.x),t=Math.abs(t.y-this.y);return Math.sqrt(e*e+t*t)}},DlRect.prototype={setFromRect:function(t){return this.x=t.x,this.y=t.y,this.w=t.w,this.h=t.h,this},setFromPoints:function(t,e){return t=t.clone().normalize(e=e.clone()),this.x=t.x,this.y=t.y,this.w=e.x-t.x+1,this.h=e.y-t.y+1,this},setFromValues:function(t,e,n,i){return this.x=t,this.y=e,this.w=n,this.h=i,this},getTL:function(){return new DlPoint(this.x,this.y)},getBR:function(){return new DlPoint(this.x+this.w-1,this.y+this.h-1)},getPoints:function(){return[getTL(),getBR()]},height:function(t){return null!=t&&(this.h=t),this.h},width:function(t){return null!=t&&(this.w=t),this.w},containsPoint:function(t){return this.x<=t.x&&this.x+this.w>t.x&&this.y<=t.y&&this.y+this.h>t.y},intersect:function(t){var e=null,n=Math,i=n.max(this.x,t.x),s=n.max(this.y,t.y),o=n.min(this.x+this.w,t.x+t.w)-i,n=n.min(this.y+this.h,t.y+t.h)-s;return e=0<o&&0<n?new DlRect(i,s,o,n):e},area:function(){return this.w*this.h},makeDiv:function(t,e){t={position:"absolute",left:this.x+"px",top:this.y+"px",width:this.w-2*(t=null==t?0:t)+"px",height:this.h-2*t+"px",overflow:"hidden",lineHeight:"1px",fontSize:"1px",border:t+"px solid "+(e=e||"#000")};return DynarchDomUtils.createElement("div",t,{innerHTML:"&nbsp;"})},positionDiv:function(t){t.style.left=this.x+"px",t.style.top=this.y+"px",t.style.height=this.h+"px",t.style.width=this.w+"px"},toString:function(){return this.w+"x"+this.h+"@"+this.x+","+this.y}},DEFINE_CLASS("DlPopup",DlContainer,function(i,t,u){var n=u.createElement,s=u.addClass,e=u.delClass,o=u.condClass,l={},r={},a={},h=/DlPopup-scroll(Up|Down)?-hover/g;function c(t,e){t._scrollStep=t._oscroll.step1,t._scrollTimer=setInterval(function(t){this.getScrollDiv().scrollTop+=this._scrollStep*t,this._scrollSetArrowState()}.$(t,e),t._oscroll.speed),s(this,"DlPopup-scroll-hover"),o(this,0<e,"DlPopup-scrollDown-hover","DlPopup-scrollUp-hover")}function d(){(l[this._objectType][this._level]=this)._autolink&&0!=this._level||(a[this.id]=this)}function _(){var t=l[this._objectType],e=t[this._level+1];e&&e.hide(),t.splice(this._level,1),a[this.id]&&delete a[this.id]}function f(t){var e,n;this.args.scrollVisible&&(n=(e=this.getScrollDiv()).scrollTop,t.wheelDelta<0?n+=20:(n-=20)<0&&(n=0),e.scrollTop=n,t.domStop=!0,DlException.stopEventBubbling())}i.BEFORE_BASE=function(){this._hasScrolling=!1,this.visible=!1},i.DEFAULT_EVENTS=["onPopup","onHide"],i.DEFAULT_ARGS={_level:["level",0],_autolink:["autolink",!0],_oscroll:["scroll",{step1:5,step2:10,speed:40}],_align:["align",null],_zIndex:["zIndex",1e3],_focusable:["focusable",!0]},t.FINISH_OBJECT_DEF=function(){i.BASE.FINISH_OBJECT_DEF.call(this),this.constructor.get=i.get,this.constructor.clearAll=i.clearAll,l[this._objectType]=[],r[this._objectType]={}},i.get=function(t,e){var n=this.prototype._objectType,i=!1,s=l[n].length,s=((null==t||s<=t)&&(t=s,i=!0),r[n]),o=(s=r[n]?s:r[n]={})[t];return(o=o||(e?null:s[t]=new this({level:t}))).detachPopup(),i&&0<t&&o.attachToPopup(l[n].peek()),o},i.clearAll=function(t){var e=l[this.prototype._objectType];(e=e[t||0])&&e.hide()},i.clearAllPopups=function(t){for(var e in a)t&&t[e]||a[e].hide()},t._createElement=function(){var t=this._parent,e=(this._parent=null,i.BASE._createElement.call(this),this.getElement());this.parent=t,this.display(!1),document.body.appendChild(e),is_gecko&&(e=n("div",null,{className:"Gecko-Bug-302380"},e)),this.refNode("_contentEl",n("div",null,{className:"DlPopup-scrollArea"},e)),this.zIndex(this._zIndex)},t.getContentElement=function(){return this._contentEl},t.getScrollDiv=t.getContentElement,t._scrollSetArrowState=function(){var t=this.getScrollDiv(),e=this._scroll_el(0),n=this._scroll_el(1),i=0==t.scrollTop,t=t.scrollTop+t.offsetHeight==t.scrollHeight;(i||t)&&this._scrollStopHandler(),o(e,i,"DlPopup-scrollUp-disabled"),o(n,t,"DlPopup-scrollDown-disabled")},t._scrollStopHandler=function(){this._scrollTimer&&(clearInterval(this._scrollTimer),this._scrollTimer=null,this._scrollSetArrowState()),e(this._scroll_el(0),h),e(this._scroll_el(1),h)},t._scrollDoubleSpeed=function(t){return this._scrollStep=this._oscroll[t?"step2":"step1"],!1},t._scroll_setup=function(){var t,e;this._hasScrolling||(this._hasScrolling=!0,e=this.getElement(),t=n("div",null,{className:"DlPopup-scrollUp"},e,0),e=n("div",null,{className:"DlPopup-scrollDown"},e),t.onmouseover=c.$(null,this,-1),e.onmouseover=c.$(null,this,1),t.onmouseout=e.onmouseout=this._scrollStopHandler.$(this),t.onmousedown=e.onmousedown=this._scrollDoubleSpeed.$(this,!0),t.onmouseup=e.onmouseup=this._scrollDoubleSpeed.$(this,!1),this.refNode("_scrollEl0",t),this.refNode("_scrollEl1",e),this.getScrollDiv().onscroll=this._scrollSetArrowState.$(this)),this._scroll_visibile(!0)},t._scroll_el=function(t){return this["_scrollEl"+t]};var p=!(t._scroll_visibile=function(t){this._hasScrolling&&(is_gecko&&(this.getScrollDiv().parentNode.style.overflow=t?"auto":""),t=t?"":"none",this._scroll_el(0).style.display=t,this._scroll_el(1).style.display=t,this.args.scrollVisible=!t)});function g(t){for(var e=t.getObject(),n={};e&&!(e instanceof i);)e.currentPopup&&(n[e.currentPopup.id]=!0),e=e.parent;if(e)for(;null!=e;)n[e.id]=!0,e=e._parentPopup;i.clearAllPopups(n)}function m(t){t.onBeforePopup&&t.onBeforePopup.call(this,t),this._timer=null,this.setContent(t.content)&&(t.onPopup&&t.onPopup.call(this,t),this.applyHooks("onPopup",[t]),this.showAt(t.anchor,t.align||this._align,t.pos,t.shift,t.fluid),this._prevFocus=DlEvent.focusedWidget(),this.focus())}function y(){if(this.visible){if(this.args&&this.args.onHide&&this.args.onHide.call(this,this.args),this._focusable&&this._prevFocus)try{this._prevFocus.focus()}catch(t){}this.args=null,this._timer=null,this.callHooks("onHide"),this.display(!1),this.visible=!1}}t._setListeners=function(){i.BASE._setListeners.call(this),this.addEventListener({onPopup:d,onMouseWheel:f,onHide:_}),p||(p=!0,DlEvent.captureGlobal("onMouseDown",g))},t.popup=function(t){this.args=t,this.cancel(),t.timeout?this._timer=m.$(this,t).delayed(t.timeout):m.call(this,t)},t.hide=function(t){this.cancel(),t?this._timer=y.$(this).delayed(t):y.call(this)},t.cancel=function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},t.correctPos=Function.noop,t.reposition=function(){this.visible&&this.showAt(this.args.anchor,this.args.align||this._align,this.args.pos,this.args.shift,this.args.fluid)},t.showAt=function(t,e,n,i,s){var o=this.getScrollDiv(),t=("mouse"==(e=e||this._align)?(l=n=null==n?Object.makeCopy(DlEvent.latestMouseEvent.pos):n,this._mouseDiff&&(l.x+=this._mouseDiff.x,l.y+=this._mouseDiff.y),e={prefer:"__",fallX1:"_R",fallX2:"_L",fallY1:"B_",fallY2:"T_"}):(l=u.getPos(t),i&&(i.x&&(l.x+=i.x),i.y)&&(l.y+=i.y)),n=u.getOuterSize(t),i=Object.makeCopy(l),this.visibility(!1),o.style.height="",this._scroll_visibile(!1),this.setPos(-3e4,-3e4),this.display(!0),is_ie&&(this.getElement().style.width=""),this._bestPosition(e,i,n)),l=t.height(),e=this.getScrollDiv().offsetHeight,n=this.getElement().offsetHeight-e,i=t.getTL();l<e&&(s?this.children(0).setSize({y:l}):(is_ie&&(this.getElement().style.width=o.offsetWidth+"px"),this._scroll_setup(),t=this._scroll_el(0).offsetHeight,e=this._scroll_el(1).offsetHeight,o.style.height=l-t-e-n+"px",this._scrollSetArrowState(),o.scrollTop=0)),this.correctPos(i),this.setPos(i.x,i.y),this._parentPopup&&(s=this._parentPopup.zIndex()+1,this.zIndex(s)),this.visibility(!0),this.visible=!0},t._bestPosition=function(t,e,n){var i=new DlRect(0,0,(o=u.getWindowSize()).x,o.y),s=new DlPoint(e),o=this.getSize(),l=(this._doAlign(t.prefer,s,n),new DlRect(s,o).intersect(i)),r=this.checkXPos(s,i),a=this.checkYPos(s,i);return 0==r&&0==a?l:(0!=r&&(s.x=e.x,this._doAlign(t.fallX1,s,n),l=new DlRect(s,o).intersect(i),s.x=e.x,this._doAlign(t.fallX2,s,n),r=new DlRect(s,o).intersect(i),l&&r?s=(l.area()>r.area()?l:r).getTL():l?s=l.getTL():r&&(s=r.getTL()),this.args.fallX=!0),0!=a&&(s.y=e.y,this._doAlign(t.fallY1,s,n),l=new DlRect(s,o).intersect(i),s.y=e.y,this._doAlign(t.fallY2,s,n),r=new DlRect(s,o).intersect(i),l&&r?s=(l.area()>r.area()?l:r).getTL():l?s=l.getTL():r&&(s=r.getTL()),this.args.fallY=!0),new DlRect(s,o).intersect(i))},t._doAlign=function(t,e,n){var i=this.getSize(),s=t.substr(0,1),o="";switch(1<t.length&&(o=t.substr(1,1)),s){case"T":e.y-=i.y,this._mouseDiff&&"mouse"==this.args.align&&(e.y-=2*this._mouseDiff.y);break;case"B":e.y+=n.y,this._mouseDiff&&"mouse"==this.args.align&&(e.y+=2*this._mouseDiff.y);break;case"C":case"c":e.y+=(n.y-i.y)/2;break;case"t":e.y+=n.y-i.y}switch(o){case"L":e.x-=i.x,this._mouseDiff&&"mouse"==this.args.align&&(e.x-=2*this._mouseDiff.x);break;case"R":e.x+=n.x,this._mouseDiff&&"mouse"==this.args.align&&(e.x+=2*this._mouseDiff.x);break;case"C":case"c":e.x+=(n.x-i.x)/2;break;case"l":e.x+=n.x-i.x}},t.checkXPos=function(t,e){var n;return t.x<e.x?t.x-e.x:(n=this.getSize(),0<(t=t.x+n.x-e.x-e.w)?t:0)},t.checkYPos=function(t,e){var n;return t.y<e.y?t.y-e.y:(n=this.getSize(),0<(t=t.y+n.y-e.y-e.h)?t:0)},t.attachToPopup=function(t){(this._parentPopup=t)._childPopup=this},t.detachPopup=function(){this._parentPopup&&(this._parentPopup._childPopup=null),this._parentPopup=null},t.getToplevelPopup=function(){for(var t=this;t._parentPopup;)t=t._parentPopup;return t},t._handle_focusKeys=function(t){var e;t.altKey||t.ctrlKey||(t.keyCode==DlKeyboard.ESCAPE?this.hide():t.keyCode==DlKeyboard.TAB&&(e=t.focusedWidget,(e=t.shiftKey?this.getPrevFocusWidget(e):this.getNextFocusWidget(e))&&e.focus(),t.domStop=!0,DlException.stopEventBubbling())),this._handleKeybinding(t)}}),DEFINE_CLASS("DlVbox",DlBox,function(t,e,n){var i=n.createElement;e.createCellElement=function(){return i("td",null,{className:"cell"},i("tr",null,{className:"row"},this._tbody))},e._removeWidgetElement=function(t){this._widgets.contains(t)&&(t=t.getElement()).parentNode.parentNode.parentNode.removeChild(t.parentNode.parentNode)}}),DEFINE_CLASS("DlPopupMenu",DlPopup,function(e,t){function n(){this.cancel();this.args}e.CONSTRUCT=function(){this._mouseDiff={x:2,y:1}},e.onBeforePopup=function(t){t.isContext?t.widget.activateSubmenu&&t.widget.activateSubmenu(!0):(t.item.currentPopup=this,t.item._popupVisible=!0,t.menu._popupVisible=!0,t.item.activateSubmenu(!0));var e=t.content;e instanceof Function&&(t.content=e=e.call(this)),e.parentMenu=t.isContext?t.widget:t.menu,e instanceof DlWidget&&e.hasHooks("onPopup")&&e.applyHooks("onPopup",[t])},e.onHide=function(t,e){var n;t.isContext?t.widget.activateSubmenu&&t.widget.activateSubmenu(!1):(t.item.activateSubmenu(!1),t.item.currentPopup=null,t.item._popupVisible=!1,t.menu._popupVisible=!1,(n=t.content)instanceof DlWidget&&n.hasHooks("onHide")&&n.applyHooks("onHide",[t]),n.parentMenu=null),e&&e.call(this,t)},t.popup=function(t){t.onBeforePopup||(t.onBeforePopup=e.onBeforePopup),t.onHide?t.onHide=e.onHide.$(this,t,t.onHide):t.onHide=e.onHide,e.BASE.popup.call(this,t)},t._setListeners=function(){e.BASE._setListeners.call(this),this.addEventListener({onMouseEnter:n})},t.correctPos=function(t){var e,n,i=this.args;try{i.isContext||i.scrollVisible||(e=i.menu)&&e instanceof DlVMenu&&(n=i.content._widgets[0].getPos().y-i.content.parent.getElement().offsetTop,Math.abs(n)<50)&&(i.fallY?t.y+=n:t.y-=n)}catch(t){}}}),DEFINE_CLASS("DlHMenu",DlHbox,function(t,e){t.CONSTRUCT=DlMenuBase,t.DEFAULT_EVENTS=["onSelect","onPopup"]}),DEFINE_CLASS("DlVMenu",DlVbox,function(t,e){t.CONSTRUCT=DlMenuBase,t.DEFAULT_EVENTS=["onSelect","onPopup"]}),DEFINE_CLASS("DlMenuItem",DlContainer,function(t,e,i){function n(){this.scrollIntoView(),this.addClass("DlMenuItem-hover","DlMenuItem-active");var t=this._inBaseMenu();t&&!this.parentMenu._popupVisible||(this._menu?this._popupMenu(t?0:250):t&&this._getDlPopup().hide(100))}function s(){this.delClass("DlMenuItem-hover"),this.delClass("DlMenuItem-active"),this._inBaseMenu()||this._getDlPopup().hide(100)}function o(){var t;this.delClass("DlMenuItem-active"),this.hasHooks("onSelect")&&(t=DlPopupMenu.get(0).args,this._noClose||DlPopupMenu.clearAll(),this.applyHooks.delayed(1,this,"onSelect",[this.name,this,t]))}function l(){this.addClass("DlMenuItem-active"),this._popupMenu(0),DlException.stopEventBubbling()}function r(){this._menu instanceof DlWidget&&(this._menu.destroy(),this._menu=null)}t.CONSTRUCT=function(){this.parentMenu||(this.parentMenu=this.parent)},t.DEFAULT_EVENTS=["onSelect"],t.DEFAULT_ARGS={label:["label","DlMenuItem"],_iconClass:["iconClass",null],_noClose:["noClose",!1],parentMenu:["menu",null],name:["name",null],__itemId:["id",null]},e._inBaseMenu=function(){return!this.parentMenu.parentMenu},e._createElement=function(){t.BASE._createElement.call(this),this.getElement().innerHTML='<div class="div1"><div class="div2"></div></div>',this.setIconClass(this._iconClass),this._iconClass=null,this.setUnselectable(),this.label&&this.setContent(this.label)},e.getContentElement=function(){return this.getElement().firstChild.firstChild},e._getDlPopup=function(){return this.parentMenu._getDlPopup()},e._popupMenu=function(t){var e,n;this._menu&&!this._popupVisible&&(e=this.parentMenu,(n=this._getDlPopup()).visible&&n.hide(),n.popup({timeout:t,content:this.getMenu(),anchor:this.getElement(),align:e._popupAlign,item:this,menu:this.parentMenu,onPopup:this._onPopup,onHide:this._onHide}))},e._setListeners=function(){t.BASE._setListeners.call(this),this.addEventListener({onMouseEnter:n,onMouseLeave:s,onMouseDown:l,onMouseUp:o,onDestroy:r})},e.getMenu=function(){return this._menu},e.setMenu=function(t,e,n){this._menu instanceof DlWidget&&this._menu.destroy(),t instanceof DlWidget&&t.ref(),this._menu=t,this._onPopup=e,this._onHide=n,i.condClass(this.getElement().firstChild,t,"DlMenuItem-withPopup")},e.activateSubmenu=function(t){this.condClass(t,"DlMenuItem-popped")}}),DEFINE_CLASS("DlButtonMenu",DlHbox,function(t,e){t.CONSTRUCT=DlMenuBase,t.DEFAULT_EVENTS=["onSelect","onPopup","onHide","onClick"],t.DEFAULT_ARGS={label:["label",null],_iconClass:["iconClass",null],_shiftMenu:["shiftMenu",null],_connected:["connected",!1]},e.ALIGN={prefer:"Br",fallX1:"_r",fallX2:"_l",fallY1:"B_",fallY2:"T_"},e.activateSubmenu=function(t){this._mainBtn.condClass(t,"DlButton-1"),this._menuBtn.condClass(t,"DlButton-1")},e._createElement=function(){t.BASE._createElement.call(this),this._mainBtn=new DlButton({parent:this,focusable:!1,label:this.label,className:"LabelPart",noCapture:this._connected,iconClass:this._iconClass}),this._mainBtn.connectEvents("onClick",this),this._menuBtn=new DlButton({parent:this,focusable:!1,label:"&nbsp;",className:"MenuArrow",noCapture:!0}),this._menuBtn.getElement().parentNode.style.width="3px",this._menuBtn.getContentElement().className="MenuArrow-inner",this._connected&&this._mainBtn.connectEvents("onMouseDown",this._menuBtn),this._mainBtn.connectEvents(["onMouseEnter","onMouseLeave"],this._menuBtn),this._menuBtn.addEventListener("onMouseDown",this._do_popupMenu.$(this)),this.addEventListener("onDestroy",this.setMenu.$(this,null))},e._do_popupMenu=function(t){var e;this._popupVisible||((e=this._getContextMenuPopup()).popup({timeout:0,content:this.getMenu(),align:this.ALIGN,anchor:this.getTableElement(),isContext:!0,widget:this,shift:this._shiftMenu,onHide:this.callHooks.$(this,"onHide")}),t instanceof DlEvent&&(t._justFocusedWidget=e),this.callHooks("onPopup"))},e.getMenu=function(){return this._menu},e.getButton=function(){return this._mainBtn},e.getArrow=function(){return this._menuBtn},e.setMenu=function(t){this._menu instanceof DlWidget&&this._menu.destroy(),t instanceof DlWidget&&t.ref(),this._menu=t}});var DlElementCache={get:function(t){return this[t].cloneNode(!0)}},DlColor=(!function(){var t,e,n,i,s=DynarchDomUtils.createElement,o=(Dynarch.ID,DlElementCache);t=document.createDocumentFragment(),s("td",null,null,s("tr",null,null,s("tbody",null,null,t))),o.TBODY_RC=t,e=s("tr"),n=s("td",null,null,e),6..times(function(){e.appendChild(n.cloneNode(!0))}),o.CAL_HEAD=s("thead"),o.CAL_HEAD.appendChild(e.cloneNode(!0)),i=o.CAL_BODY=s("tbody"),6..times(function(){i.appendChild(e.cloneNode(!0))}),o.DRAGGING_LINE=s("div",null,{className:"DlResizeBar-DraggingLine"})}(),DEFINE_CLASS("DlCalendar",DlWidget,function(u,t,e){var h=e.createElement,o=e.addClass,n=e.delClass,l=e.condClass,i=(u.FIXARGS=function(t){t.tagName="table",this._dayNamesOn=-1,this._selectedDate=t.date&&t.selected?t.date.getDate():0},u.CONSTRUCT=function(){this._noinit||this.init()},u.DEFAULT_EVENTS=["onSelect","onChange","onRendered"],u.DEFAULT_ARGS={firstDay:["firstDay",Date.getFirstDayOfWeek()],fixedFirstDay:["fixedFirstDay",!0],_weekNumbers:["weekNumbers",!1],date:["date",null],selected:["selected",!0],_navigation:["navigation",2],_navDisabled:["navDisabled",!1],_omDisabled:["omDisabled",!1],_noinit:["noinit",!1],_withMenu:["withMenu",!1],_disableHandler:["disableHandler",Function.returnFalse],_cal_tooltip:["dayTooltip",null],_infoDates:["infoDates",null],__tooltip:["tooltip",function(){var t,e,n=this.args.widget;(e=n._currentHover)&&(t=e._info);return(e=n._cal_tooltip)?e.call(n,t):t?t.tooltip:null}]},t._createElement=function(){u.BASE._createElement.call(this);var t,e,n,i,s,o,l,r=this.getElement(),a=DlElementCache.get("CAL_BODY");if(r.cellSpacing=r.cellPadding=r.border=0,r.appendChild(DlElementCache.get("CAL_HEAD")),r.appendChild(a),this._weekNumbers)for(e=(t=r.getElementsByTagName("tr")).length;0<=--e;)n=t[e],i=h("td",null,{className:"DlCalendar-WeekNumber"}),n.insertBefore(i,n.firstChild);n=h("tr"),i=h("td",null,null,n),n.className="DlCalendar-Navigation",0==this._navigation?(i.colSpan=this.getNCols(),this._makeNavPart(i,0)):(a=h("td",null,null,n),s=h("td",null,null,n),1==this._navigation?(a.colSpan=this.getNCols()-2,this._makeNavPart(a,0,i,-1,s,1)):2==this._navigation&&(o=h("td",null,null,n),l=h("td",null,null,n),s.colSpan=this.getNCols()-4,this._makeNavPart(s,0,i,-2,a,-1,o,1,l,2))),(e=r.rows[0]).parentNode.insertBefore(n,e),this.setUnselectable(),this._withMenu&&this._createQuickNavMenu()},null);function s(){var e;return i||((i=new DlVMenu({})).setStyle("textAlign","center"),new DlMenuItem({parent:i,label:DlTEXTS.goToday,name:"today",noClose:!0}),i.addSeparator(),(e=new DlSpinner({parent:i,size:4})).addEventListener("onChange",function(){e.validationError||i.calendar.setYear(e.getValue())}),e.getElement().align="center",i.addSeparator(),12..times(function(t){new DlMenuItem({parent:i,label:Date.getMonthName(t),name:t,noClose:!0})}),i.addEventListener("onPopup",function(t){this.calendar=t.widget,e.setValue(this.calendar.date.getFullYear()),e.focus.$(e).delayed(5)}),i.addEventListener("onSelect",function(t){"today"==t?this.calendar.setToday():(this.calendar.setMonth(t),this.calendar.setYear(e.getValue())),i.getParent(DlPopup).hide()})),i}function r(t){this._clearTimer();t=t.getParentElement("td",this);t&&(this._currentHover&&(n(this._currentHover,"hover"),n(this._currentHover,"rolling"),this._currentHover=null,DlWidget.getTooltip().hide()),null!=t._navType&&this._navDisabled||t._otherMonth&&this._omDisabled||null!=t._firstDay&&this.fixedFirstDay||null!=t._week||t.disabled||(o(t,"hover"),this._currentHover=t,this.__tooltip&&this._popupTooltip()))}function a(t){this._clearTimer(),this._currentHover&&(n(this._currentHover,"hover"),n(this._currentHover,"rolling"),this._currentHover=null)}function c(t){r.call(this,t);var e,n,i=t.getParentElement("td",this);!i||0!=t.button&&(null!=i._navType||i._otherMonth)||i._otherMonth&&this._omDisabled||i.disabled||(null!=i._navType&&"onMouseDown"==t.dl_type?this._navDisabled||this._navCellClicked(i,0!=i._navType?350:0,t):null!=i._year&&"onMouseUp"==t.dl_type?((e=this.date).setFullYear(i._year,i._month,i._iday),n=this._selectedDate,this._selectedDate=i._iday,i._otherMonth?(this.init(),this.applyHooks("onSelect",[!1,!0,!1,e])):n!=this._selectedDate?this._selectCell(i,!0):this.applyHooks("onSelect",[!1,!1,!0,e])):null==i._firstDay||this.fixedFirstDay||0!=t.button||"onMouseDown"!=t.dl_type||(this.firstDay=i._firstDay,this._displayCalendar()))}t._createQuickNavMenu=function(){this.setContextMenu(s)},t._makeNavPart=function(){for(var t,e=0;e<arguments.length;++e)switch((t=arguments[e++])._navType=arguments[e]){case-2:t.className="PrevYear";break;case-1:t.className="PrevMonth";break;case 0:t.className="Month",this.refNode("_monthTD",t);break;case 1:t.className="NextMonth";break;case 2:t.className="NextYear"}},t.getNCols=function(){return this._weekNumbers?8:7},t.getTableElement=function(){return this.getElement()},t._displayDayNames=function(){var t,e=(new Date).getDay(),n=this.getTableElement().getElementsByTagName("tr")[1],i=this._weekNumbers?1:0,s=this.firstDay;for(n.className="DlCalendar-DayNames";t=n.cells[i++];)t._firstDay=s%7,l(t,s==e,"Today"),t.innerHTML=Date.getDayName(s++,!0),l(t,Date.isWeekend(t._firstDay),"WeekEnd");this._dayNamesOn=this.firstDay,this._weekNumbers&&((t=n.cells[0]).innerHTML="w",t._week=-1,t.className="WeekNumber")},t._displayCalendar=function(){for(var t,e=new Date,n=e.getFullYear(),i=e.getMonth(),s=e.getDate(),o=(this._selectedTD=null,this._dayNamesOn!=this.firstDay&&this._displayDayNames(),new Date(this.date)),l=(o.setHours(12),o.getMonth()),e=(o.getDate(),o.getFullYear()),e=(o.getMonthDays(),this._monthTD.innerHTML=String.buffer("<b>",Date.getMonthName(l,2==this._navigation),"</b> ",e).get(),o.setDate(1),(o.getDay()-this.firstDay)%7),r=(e<0&&(e+=7),o.setDate(-e),o.setDate(o.getDate()+1),this.getTableElement().rows[2]),a=this._cells=[],u=this._displayedInterval={},h=0;h<6;++h,r=r.nextSibling){r.className="Dates";var c,d=r.firstChild;this._weekNumbers&&(d.className="WeekNumber",d.innerHTML=d._week=o.getWeekNumber(),d=d.nextSibling);for(var _=0;_<7;++_,d=d.nextSibling,o.setDate(c+1)){var f,p=o.getDay(),g=[];d._iday=c=o.getDate(),d._month=o.getMonth(),d._year=o.getFullYear(),d._info=null,t={y:d._year,m:d._month,d:d._iday},this._infoDates&&(f=t.y+"-"+(1+t.m).zeroPad(2)+"-"+t.d.zeroPad(2),f=this._infoDates[f])&&(d._info=f,g.push(f.className||"DlCalendar-infoDay")),u.start||(u.start=t),(d._otherMonth=l!=t.m)?(g.push("OtherMonth"),a[c+(15<c?100:200)]=d):(l==i&&c==s&&n==t.y&&g.push("Today"),this._selectedDate==c&&(this._selectCell(d),g.push("Selected")),a[c]=d),0!=p&&6!=p||g.push("WeekEnd"),d.disabled=this._disableHandler(o,g,d),d.innerHTML=this.getDayHTML(c),d.className=g.join(" ")}}u.end=t,this.applyHooks("onRendered",[this])},t.getDayHTML=Function.identity,t.getDateCell=function(t){return this._cells[t]},t.getDisplayedInterval=function(){return this._displayedInterval},t.selectDate=function(t,e){t instanceof Date&&(t.dateEqualsTo(this.date,!0)||(this.date=new Date(t),this.init()),t=t.getDate()),this._selectCell(this.getDateCell(t),!e)},t.clearSelection=function(){this._selectedDate=null,this._initialized&&this._displayCalendar()},t.setYear=function(t){t!=this.date.getFullYear()&&(this.date.setFullYear(t),this.init())},t.setMonth=function(t){t!=this.date.getMonth()&&(this.date.setMonth(t),this.init())},t.setToday=function(){var t=new Date;this._selectedDate=0,this.date=t,this.init()},t._navCellClicked=function(t,e,n){o(t,"rolling"),this._selectedDate=0;var i=this.date;switch(0!=t._navType&&i.setDate(1),t._navType){case 0:if(this._withMenu)this.applyHooks("onContextMenu",[n]);else{var s=new Date;if(i.dateEqualsTo(s,!0))return;this.date=s}break;case-2:i.setFullYear(i.getFullYear()-1);break;case-1:i.setMonth(i.getMonth()-1);break;case 1:i.setMonth(i.getMonth()+1);break;case 2:i.setFullYear(i.getFullYear()+1)}this.init(),this.applyHooks("onChange",[t._navType]),this.applyHooks("onSelect",[!0,t._navType,null,i]),e&&0!=t._navType&&(++this._timerStep,this._timer=setTimeout(this._navCellClicked.$(this,t,4<this._timerStep?50:100),e))},t._clearTimer=function(){this._timer&&clearTimeout(this._timer),this._timer=null,this._timerStep=0},t._selectCell=function(t,e){this._selectedDate=t._iday,this._selectedTD&&(n(this._selectedTD,"Selected"),n(this._selectedTD.parentNode,"Selected")),this._selectedTD=t,o(t,"Selected"),o(t.parentNode,"Selected"),n(t,"hover"),e&&this.applyHooks("onSelect",[!1,!1,!1,this.date])},t._setListeners=function(){u.BASE._setListeners.call(this),this.addEventListener({onMouseOver:r,onMouseLeave:a,onMouseUp:c,onMouseDown:c})},t.setInfoDates=function(t){this._infoDates=t,this._initialized&&this._displayCalendar()},t.init=function(){this.date||(this.date=new Date),this._displayCalendar(),this._initialized=!0},t.setSize=t.setOuterSize=function(t){u.BASE.setOuterSize.call(this,{x:null!=t.x?t.x+2:null,y:t.y})}}),DEFINE_CLASS("DlButtonCalendar",DlButtonMenu,function(e,t){e.DEFAULT_ARGS={dateFormat:["dateFormat","%Y/%m/%d"],_calendarArgs:["calendar",{}],_iconClass:["iconClass","IconCalendar"],date:["date","Select date..."]},e.DEFAULT_EVENTS=["onSelect","onCalendarRendered"],t.getCalendar=function(){var t=this._calendar;return t||(this._calendarArgs.noinit=!0,t=this._calendar=new DlCalendar(this._calendarArgs),this.addEventListener("onDestroy",t.destroy.$(t)),t.addEventListener("onSelect",function(t,e,n){e||(this.getButton().setContent(t.date.print(this.dateFormat)),DlPopup.clearAllPopups(),this.date=new Date(t.date),this.applyHooks("onSelect",[this.date]))}.$(this,t)),t.connectEvents("onRendered",this,"onCalendarRendered"),this.date instanceof Date&&(t.date=new Date(this.date)),t.init()),this._calendar},t.initDOM=function(){e.BASE.initDOM.call(this);var t=this.getButton();this.date instanceof Date?t.label(this.date.print(this.dateFormat)):t.label(this.date),this.setMenu(this.getCalendar.$(this)),t.addEventListener("onClick",function(t){var e;this.date instanceof Date&&((e=this.getCalendar()).date.dateEqualsTo(this.date)||(e.date=new Date(this.date),e._selectedDate=this.date.getDate(),e.init())),this.getArrow().applyHooks("onMouseDown",[t])}.$(this))},t.getValue=function(){return this.date instanceof Date?this.date:null}}),DEFINE_CLASS("DlButtonColorPicker",DlButtonMenu,function(t,e,n){function i(t,e,n,i,s){t.getColorElement().style.backgroundColor=i,t.hsv=Array.$(n),t._updateValues(),DlPopup.clearAllPopups(),t.applyHooks("onSelect",[e,n,i,s])}function s(){this._cp.addEventListener(this._events_cp),this.hsv&&this._cp.setHSV(this.hsv)}function o(){this._cp.removeEventListener(this._events_cp)}t.CONSTRUCT=function(){this._events_cp={onSelect:i.$(null,this),onHueChange:function(t,e){{var n;t.hsv&&(e=[e,t.hsv[1],t.hsv[2]],n=DlColor.RGB2color(DlColor.HSV2RGB(e)),t.getColorElement().style.backgroundColor=n,t.hsv=e,t._updateValues())}}.$(null,this),onHover:function(t,e,n,i,s){t.getColorElement().style.backgroundColor=i}.$(null,this),onHoverOut:function(t){t.getColorElement().style.backgroundColor=t.rgb?DlColor.RGB2color(t.rgb):""}.$(null,this)},this._updateValues()},t.DEFAULT_ARGS={rgb:["rgb",null],hsv:["hsv",null],color:["color",null]},e._updateValues=function(){this.hsv?(this.rgb=DlColor.HSV2RGB(this.hsv),this.color=DlColor.RGB2color(this.rgb)):this.rgb?(this.hsv=DlColor.RGB2HSV(this.rgb),this.color=DlColor.RGB2color(this.rgb)):this.color&&(this.rgb=DlColor.color2RGB(this.color),this.hsv=DlColor.RGB2HSV(this.rgb))},e.setColorPicker=function(t){this._cp=t,this.setMenu(t),this.hsv&&(t.setHSV(this.hsv),i.call(t,this,this.rgb,this.hsv,DlColor.RGB2color(this.rgb),DlColor.RGBrightness(this.rgb)))},e._createElement=function(){t.BASE._createElement.call(this);this.getButton().setContent(["<table cellspacing='0' cellpadding='0'><tr><td>","<div unselectable='on' class='ColorPart'>&nbsp;</div>","</td><td></td></tr></table>"].join(""));this.setLabel(this.label)},e.setLabel=function(t){var e=this.getLabelElement();e.innerHTML=t||"",n.condClass(e,t,"Label","EmptyLabel")},e.getColorElement=function(){return this.getButton().getContentElement().firstChild.rows[0].cells[0].firstChild},e.getLabelElement=function(){return this.getButton().getContentElement().firstChild.rows[0].cells[1]},e._setListeners=function(){t.BASE._setListeners.call(this),this.addEventListener({onPopup:s,onHide:o})}}),DEFINE_CLASS("DlCanvas",DlContainer,function(o,t,e){var n="onMouseMove onMouseDown onMouseUp onMouseEnter onMouseLeave onClick",i=DlException.stopEventBubbling;function s(s){return function(t){var e=t.computePos(this),n=this.getContext(),i=[e.x,e.y,n,this,t];return s.call(this,t,e,n,i)}}function l(o){o.registerEvents(["onMove"]),o._dragHandlers={onMouseMove:function(t){t=t.computePos(o.cw);t={x:t.x+o._dragDiff.x,y:t.y+o._dragDiff.y},o.setPos(t.x,t.y),o.applyHooks("onMove",[t]),o.cw.refresh(),i()},onMouseUp:function(){DlEvent.releaseGlobals(o._dragHandlers),o.dragging=!1,o.cw.refresh(),o.cw=null,o.ctx=null,o._dragPos=null},onMouseOver:i,onMouseOut:i,onMouseEnter:i,onMouseLeave:i},o.addEventListener({onMouseDown:function(t,e,n,i,s){o.dragging=!0,o.ctx=n,o.cw=i;n=o.getPos();o._dragDiff={x:n.x-t,y:n.y-e},DlEvent.captureGlobals(o._dragHandlers),s.domStop=!0}})}o.DEFAULT_ARGS={width:["width",100],height:["height",100]},o.CONSTRUCT=function(){this._elements=[],this._activeEl=null,this._noUpdates=0},t.setMouseListeners=function(){n.qw().foreach(function(t){this[t]instanceof Function&&this.addEventListener(t,this[t])},this)},t._createElement=function(){o.BASE._createElement.apply(this,arguments),this.setContent("<canvas width='"+this.width+"' height='"+this.height+"'></canvas>")},t.getCanvas=function(){return this.getContentElement().firstChild},t.getContext=function(){return this._context||this.refNode("_context",this.getCanvas().getContext("2d"))},t.withContext=function(t){t(this.getContext())},t.withSavedContext=function(t){this.getContext().save();try{return t(this.getContext())}finally{this.getContext().restore()}},t.setSize=function(t){this.getCanvas().width=t.x,this.getCanvas().height=t.y,this.refresh(),this.callHooks("onResize")},t.add=function(t){this._elements.push(t),this.refresh()},t.clear=function(){var t=this.getCanvas();this.getContext().clearRect(0,0,t.width,t.height)},t.refresh=function(){0==this._noUpdates&&(this.clear(),this.getSortedElements().reverse().foreach(this.renderElement,this))},t.getSortedElements=function(){var t=this._elements.mergeSort(a);return this._activeEl&&t.unshift.apply(t,this._activeEl.handles()),t},t.renderElement=function(t){var e=this.getContext();e.save(),t.render(e,this),e.restore()},t.withNoUpdates=function(t){++this._noUpdates;try{return t()}finally{--this._noUpdates}},t.onMouseMove=s(function(t,e,n,i){this.getSortedElements().foreach(function(t){t.pointInside(e,n)?(t.__mouseInside||(t.__mouseInside=!0,t.applyHooks("onMouseEnter",i)),t.applyHooks("onMouseMove",i)):t.__mouseInside&&(t.__mouseInside=!1,t.applyHooks("onMouseLeave",i))},this)}),t.onMouseLeave=s(function(t,e,n,i){this.getSortedElements().foreach(function(t){t.__mouseInside&&(t.__mouseInside=!1,t.applyHooks("onMouseLeave",i))},this)}),t.onMouseDown=s(function(t,e,n,i){var s=!1;this.getSortedElements().foreach(function(t){t.pointInside(e,n)&&(t instanceof o.Handle?s=!0:!s&&t.activable()&&(t!==this._activeEl&&(this._activeEl&&this._activeEl.applyHooks("onActivate",[!1]),t.applyHooks("onActivate",[!0]),this._activeEl=t),s=!0),t.applyHooks("onMouseDown",i),$BREAK())},this),s?this.refresh():this._activeEl&&(this._activeEl.applyHooks("onActivate",[!1]),this._activeEl=null,this.refresh())}),t.onMouseUp=s(function(t,e,n,i){this.getSortedElements().foreach(function(t){t.pointInside(e,n)&&t.applyHooks("onMouseUp",i)},this)}),t.onClick=s(function(t,e,n,i){this.getSortedElements().foreach(function(t){t.pointInside(e,n)&&t.applyHooks("onClick",i)},this)}),o.make_movable=l,o.make_resizable=function(e){function n(){Object.foreach(e._handles,function(t){t.update()})}function i(t,e,n){var i=n(),i=new r(i[0],i[1]);i.update=function(){var t=n();this.setPos(t[0],t[1])},(t._handles[e]=i).addEventListener("onMove",s[e])}e._handles={},l(e),e.addEventListener({onActivate:function(t){t?(i(e,"TL",function(){return[e.left(),e.top()]}),i(e,"T",function(){return[e.hcenter(),e.top()]}),i(e,"TR",function(){return[e.right(),e.top()]}),i(e,"L",function(){return[e.left(),e.vcenter()]}),i(e,"R",function(){return[e.right(),e.vcenter()]}),i(e,"BL",function(){return[e.left(),e.bottom()]}),i(e,"B",function(){return[e.hcenter(),e.bottom()]}),i(e,"BR",function(){return[e.right(),e.bottom()]})):(Array.hashKeys(this._handles).map("destroy"),this._handles={})},onMove:function(){n()}}),e.handles=function(){return Array.hashValues(this._handles)},e.activable=function(){return!0};var s={TL:function(t){e.left(t.x),e.top(t.y),n()},T:function(t){e.top(t.y),n()},TR:function(t){e.right(t.x),e.top(t.y),n()},L:function(t){e.left(t.x),n()},R:function(t){e.right(t.x),n()},BL:function(t){e.left(t.x),e.bottom(t.y),n()},B:function(t){e.bottom(t.y),n()},BR:function(t){e.right(t.x),e.bottom(t.y),n()}}},o.Element=DEFINE_CLASS(null,DlEventProxy,function(t,e){t.CONSTRUCT=function(){this._zIndex=0},t.DEFAULT_EVENTS=(n+" onActivate").qw(),e.pointInside=function(t,e){return e.save(),this.setMyPath(e),e.restore(),e.isPointInPath(t.x,t.y)},e.handles=function(){return[]},e.activable=function(){return!1},e.setClipPath=function(t){this.setMyPath(t)},e.zIndex=function(t){return null!=t&&(this._zIndex=t),this._zIndex}}),o.Rect=DEFINE_CLASS(null,o.Element,function(t,e){t.CONSTRUCT=function(t,e,n,i){this._p1=new DlPoint(t,e),this._p2=new DlPoint(t+n,e+i),this.normalize()},e.normalize=function(){this._p1.normalize(this._p2)},e.rectangle=function(){return new DlRect(this._p1,this._p2)},e.left=function(t){return null!=t&&(this._p1.x=t,this.normalize()),this._p1.x},e.top=function(t){return null!=t&&(this._p1.y=t,this.normalize()),this._p1.y},e.right=function(t){return null!=t&&(this._p2.x=t,this.normalize()),this._p2.x},e.bottom=function(t){return null!=t&&(this._p2.y=t,this.normalize()),this._p2.y},e.hcenter=function(){return(this.left()+this.right())/2},e.vcenter=function(){return(this.top()+this.bottom())/2},e.width=function(t){return Math.abs(this._p2.x-this._p1.x)},e.height=function(t){return Math.abs(this._p2.y-this._p1.y)},e.getPos=function(){return this._p1},e.setPos=function(t,e){var n;null!=t&&(n=t-this._p1.x,this._p1.x=t,this._p2.x+=n),null!=e&&(t=e-this._p1.y,this._p1.y=e,this._p2.y+=t)},e.setMyPath=function(t){t.beginPath(),t.translate(this.hcenter(),this.vcenter());var e=this.width(),n=this.height();t.rect(-(e/2),-(n/2),e,n),t.closePath()},e.render=function(t){t.fillStyle="#ffffff",t.strokeStyle="#000000",this.setMyPath(t),t.fill(),t.stroke()}}),o.Ellipse=DEFINE_CLASS(null,o.Rect,function(t,e){e.setMyPath=function(t){t.beginPath(),t.translate(this.hcenter(),this.vcenter());var e,n,i,s,o,l,r,a=this.width(),u=this.height();s=(n=a)/2*.5522848,o=(i=u)/2*.5522848,l=(a=-(a/2))+n,r=(u=-(u/2))+i,n=a+n/2,i=u+i/2,(e=t).moveTo(a,i),e.bezierCurveTo(a,i-o,n-s,u,n,u),e.bezierCurveTo(n+s,u,l,i-o,l,i),e.bezierCurveTo(l,i+o,n+s,r,n,r),e.bezierCurveTo(n-s,r,a,i+o,a,i),t.closePath()}});var r=o.Handle=DEFINE_CLASS(null,o.Element,function(t,e){var o="#5500ff";t.CONSTRUCT=function(t,e,n){var s=this;l(s),s._point=new DlPoint(t,e),s._size=n||4,s.addEventListener({onMouseEnter:function(t,e,n,i){i.withSavedContext(function(t){t.strokeStyle=o,t.fillStyle="rgba(255, 0, 0, 0.5)",s.setMyPath(t),t.fill(),t.stroke()})},onMouseLeave:function(t,e,n,i){i.withSavedContext(function(t){s.setClipPath(t),t.clip(),i.refresh()})}})},e.setMyPath=function(t){t.beginPath(),t.arc(this._point.x,this._point.y,this._size,0,2*Math.PI,!0),t.closePath()},e.setClipPath=function(t){t.beginPath(),t.rect(this._point.x-this._size-1,this._point.y-this._size-1,2*this._size+2,2*this._size+2),t.closePath()},e.render=function(t){t.fillStyle=this.dragging?o:"rgba(0, 0, 0, 0.5)",this.setMyPath(t),t.fill()},e.zIndex=function(){return 1e5},e.setPos=function(t,e){null!=t&&(this._point.x=t),null!=e&&(this._point.y=e)},e.getPos=function(){return this._point}});function a(t,e){return e.zIndex()-t.zIndex()}}),DEFINE_CLASS("DlCheckbox",DlAbstractButton,function(t,e){t.DEFAULT_ARGS={_classes:["classes",{active:"DlCheckbox-active",hover:"DlCheckbox-hover",checked:"DlCheckbox-1",unchecked:"DlCheckbox-0",empty:"DlCheckbox-empty",disabled:"DlCheckbox-disabled"}]},t.FIXARGS=function(t){t.type=DlButton.TYPE.TWOSTATE}}),{RGB2HSV:function(t){var e,n,i=t[0],s=t[1],t=t[2],o=Math.min(i,s,t),l=Math.max(i,s,t),o=l-o;return 0!=l?(n=o/l,e=i==l?(s-t)/o:s==l?2+(t-i)/o:4+(i-s)/o,(e*=60)<0&&(e+=360)):(n=0,e=-1),[e,n,l]},HSV2RGB:function(t){var e,n,i,s,o,l,r=t[0],a=t[1],u=t[2];if(0==a)e=n=i=u;else switch(s=u*(1-a),o=u*(1-a*(r=(r/=60)-(t=Math.floor(r)))),l=u*(1-a*(1-r)),t){case 0:e=u,n=l,i=s;break;case 1:e=o,n=u,i=s;break;case 2:e=s,n=u,i=l;break;case 3:e=s,n=o,i=u;break;case 4:e=l,n=s,i=u;break;default:e=u,n=s,i=o}return[e,n,i]},RGB2bytes:function(t){var e=new Array(3);return e[0]=Math.round(255*t[0]),e[1]=Math.round(255*t[1]),e[2]=Math.round(255*t[2]),e},RGB2color:function(t){return String.buffer("rgb(",100*t[0],"%,",100*t[1],"%,",100*t[2],"%)").get()},RGB2hex:function(t){return(t=DlColor.RGB2bytes(t))[0].hex(2)+t[1].hex(2)+t[2].hex(2)},color2RGB:function(t){if(/^#/.test(t))return 4==t.length&&(t=t.replace(/([a-f0-9])/gi,"$1$1")),[parseInt(t.substr(1,2),16)/255,parseInt(t.substr(3,2),16)/255,parseInt(t.substr(5,2),16)/255];throw new DlException("Can't parse color: "+t)},brighter:function(t){t=Array.$(t);return t[1]-=.5,t[1]<0&&(t[1]=0),t},darker:function(t){t=Array.$(t);return t[2]-=.5,t[2]<0&&(t[2]=0),t},RGBrightness:function(t){return(299*t[0]+587*t[1]+114*t[2])/1e3}}),DlKeyboard=(DEFINE_CLASS("DlColorPickerHSV",DlWidget,function(t,e,n){var i=n.delClass,s=n.condClass,o=(t.DEFAULT_EVENTS=["onSelect","onHover","onHoverOut","onHueChange"],String.buffer("<table cellspacing='1' cellpadding='0' border='0'>","<tbody>","<tr>","<td></td>".repeat(11),"<td rowspan='11' class='DlColorPickerHSV-Sep'></td>","<td rowspan='11' class='DlColorPickerHSV-HSV' hueCell='1'>","<div class='DlColorPickerHSV-HSV-bar'></div>","</td>","</tr>",("<tr>"+"<td></td>".repeat(11)+"</tr>").repeat(10),"</tbody></table>").get());function l(t){var e=t.target;try{for(;e&&"td"!=e.tagName.toLowerCase();)e=e.parentNode}catch(t){e=null}return e}function r(t){t=l(t);if(t)throw t.rgb&&this.applyHooks("onSelect",[t.rgb,t.hsv,t.style.backgroundColor,DlColor.RGBrightness(t.rgb)]),new DlExStopEventBubbling}function a(t){var e=l(t);if(e)throw e.getAttribute("hueCell")&&(t.computePos(this),this._refresh(t),DlEvent.captureGlobals(this._dragHandlers)),new DlExStopEventBubbling}function u(t){this._currentHover&&(i(this._currentHover,"hover1"),i(this._currentHover,"hover2"));var e,t=l(t);t&&(t.rgb?(this._currentHover=t,e=DlColor.RGBrightness(t.rgb),s(t,.6<e,"hover2","hover1"),this.applyHooks("onHover",[t.rgb,t.hsv,t.style.backgroundColor,e])):this._currentHover&&(this.callHooks("onHoverOut"),this._currentHover=null))}function h(){var t=this._currentHover;t&&(i(t,"hover1"),i(t,"hover2"),this.callHooks("onHoverOut")),this._currentHover=null}e.getHueBarElement=function(){return this.getElement().rows[0].cells[12].firstChild},e._createElement=function(){t.BASE._createElement.call(this,o),this.setUnselectable()},e.initDOM=function(){t.BASE.initDOM.call(this),this.addEventListener({onMouseUp:r,onMouseDown:a,onMouseOver:u,onMouseLeave:h}),this._dragHandlers={onMouseMove:function(t){var e=t.computePos(this).y-2;throw e<0?e=0:119<e&&(e=119),this.getHueBarElement().style.top=e+"px",this.__cphsvTimeout&&clearTimeout(this.__cphsvTimeout),this.__cphsvTimeout=this._refresh.$(this,t).delayed(5),new DlExStopEventBubbling}.$(this),onMouseUp:function(t){throw DlEvent.releaseGlobals(this._dragHandlers),new DlExStopEventBubbling}.$(this),onMouseOver:DlException.stopEventBubbling,onMouseOut:DlException.stopEventBubbling,onMouseEnter:DlException.stopEventBubbling,onMouseLeave:DlException.stopEventBubbling},this._redraw(360)},e._refresh=function(t){t=Math.limit(t.relPos.y-2,0,119),t=Math.round(360*(1-t/120)),t=this._redraw(t);this.applyHooks("onHueChange",[t]),this.__cphsvTimeout=null},e.setHSV=function(t){this._redraw(t[0])},e._redraw=function(t){var e,n,i,s,o=this.getHueBarElement(),l=this.getElement().rows,r=l.length-1,a=l[0].cells.length-3;for(o.style.top=120-t/3+"px",360==t&&(t=0),e=r;0<=e;--e)for(s=l[e].cells,i=a;0<=i;--i)(n=s[i]).hsv=[t,1-e/r,i/a],n.rgb=DlColor.HSV2RGB(n.hsv),n.style.backgroundColor=DlColor.RGB2color(n.rgb);return t}}),DEFINE_CLASS("DlEntry",DlContainer,function(n,t,r){var o=r.createElement;function e(){this.validate()}function i(t){this._isEmpty=!1,t.keyCode==DlKeyboard.ENTER?this.applyHooks("onKey-ENTER",[t]):t.keyCode==DlKeyboard.ESCAPE&&this.applyHooks("onKey-ESCAPE",[t])}n.FIXARGS=function(t){t.tagName="table",this._isTextArea="textarea"==t.type},n.DEFAULT_EVENTS=["onChange","onKey-ENTER","onKey-ESCAPE","onValidationError","onValidation","onPaste","onCopy","onCut"],n.DEFAULT_ARGS={_domType:["type","text"],_value:["value",null],_size:["size",null],_rows:["rows",null],_readonly:["readonly",!1],_emptyText:["emptyText",""],_emptyValue:["emptyValue",""],_width:["width",null],_name:["name",null],_validators:["validators",[]],_allowEmpty:["allowEmpty",null],_focusable:["focusable",2],_maxlen:["maxlength",null],_noSelect:["noSelect",!1],_trim:["trim",!1],_noWrap:["noWrap",!1]},t.validate=function(t){if(null==t&&(t=this.getValue(!0)),null!=this._allowEmpty&&!/\S/.test(t))return this.condClass(!this._allowEmpty,"DlEntry-ValidationError"),this.applyHooks("onValidation",[!this._allowEmpty]),this._allowEmpty;for(var e,n=this._validators,i=!1,s=0;s<n.length;++s)if(!(e=n[s]).ok(t)){i=e.getError()||!0;break}return e&&!i&&this.setValue(e.getLastVal(),!0),this.validationError=i,this._noSelect||!this._focused||this.readonly()||"textarea"==this._domType||this.select(),this.condClass(i,"DlEntry-ValidationError"),this.applyHooks("onValidation",[i]),i&&(this.setInvalidTooltip(i.message),this.applyHooks("onValidationError",[i])),!i},t.setInvalidTooltip=function(t){this._invalidTooltip.setTooltip(t)},t.timerFocus=function(t){return this.focus.clearingTimeout(t||10,this)},t.select=function(){try{is_gecko?this.setSelectionRange(0,this.getValue(!0).length):this.getInputElement().select()}catch(t){}},t.focus=function(){this.getInputElement().focus(),this._noSelect||this.readonly()||"textarea"==this._domType||this.select()},t.blur=function(){this.getInputElement().blur()},t.__setEmpty=function(t){return null==t&&(t=this.getInputElement().value),this._isEmpty=this.__checkEmpty(t),this._isEmpty?this._focused?this.getInputElement().value=t:(this.addClass("DlEntry-empty"),this.getInputElement().value=""):this.delClass("DlEntry-empty"),this._isEmpty},t.__checkEmpty=function(t){return""===(t=null==t?this.getInputElement().value:t)},t._createElement=function(){n.BASE._createElement.apply(this,arguments);var t=this.getElement(),e=(t.appendChild(DlElementCache.get("TBODY_RC")),t.cellSpacing=t.cellPadding=t.border=0,(t=t.rows[0].cells[0]).className="DlEntry-cell",this._isTextArea?document.createElement("textarea"):document.createElement("input"));switch(e.id=this.id+"-input",e.setAttribute("autocomplete","off",1),this._noWrap&&e.setAttribute("wrap","off"),this._isTextArea&&this._rows&&(e.rows=this._rows),null!=this._maxlen&&e.setAttribute("maxlength",this._maxlen),this._domType){case"password":case"file":case"hidden":e.type=this._domType}is_gecko&&gecko_version<1.9&&!this._no_gecko_bug&&(t=o("div",null,{className:"Gecko-Bug-226933"},t)),t=o("div",{position:"relative",overflow:"hidden"},null,t),this._emptyText&&o("label",null,{htmlFor:this.id+"-input",className:"DlEntry-emptyText",innerHTML:this._emptyText.htmlEscape()},t),t.appendChild(e),this.refNode("_invalidTooltip",new DlWidget({className:"DlEntry-invalidIcon",parent:this,appendArgs:t}))},t.getInputElement=function(){return this.getElement().getElementsByTagName(this._isTextArea?"textarea":"input")[0]},t.getContentElement=t.getInputElement,t.setIfEmpty=function(t,e){this._isEmpty&&t&&this.setValue(t,e)},t.isEmpty=function(){return this.__checkEmpty()},t.setValue=function(t,e){var n;this.__setEmpty(t)||(null!=this._maxlen&&(t=String(t).substr(0,this._maxlen)),(n=this.getInputElement()).value=t,n.defaultValue=t),e||this.callHooks("onChange")},t.isDirty=function(){var t=this.getInputElement();return t.value!=t.defaultValue},t.clear=function(t){return this.setValue("",t),this},t.getValue=function(t){t=!t&&this.isEmpty()?this._emptyValue:this.getInputElement().value;return t=this._trim&&"string"==typeof t?t.trim():t},t.getSelectionRange=function(){return r.getSelectionRange(this.getInputElement())},t.setSelectionRange=function(t,e){r.setSelectionRange(this.getInputElement(),t,e)},t.moveEOF=function(){var t=this.getValue(!0).length;this.setSelectionRange(t,t)},t.moveBOF=function(){this.setSelectionRange(0,0)},t.collapse=function(t){var e=this.getSelectionRange(),e=t?e.start:e.end;this.setSelectionRange(e,e)},t.insertReplacingSelection=function(t,e){var n=this.getSelectionRange(),i=this.getValue();this.setValue(i.substr(0,n.start)+t+i.substr(n.end)),this.setSelectionRange(n.start,e?n.start+t.length:n.start)},t.initDOM=function(){n.BASE.initDOM.call(this);var t=this.getInputElement();r.addEvent(t,{focus:this._on_element_focus=function(){this.addClass("DlEntry-Focus"),this._focused=!0,n.BASE.focus.call(this),this._isEmpty&&(this.getInputElement().value="",this.delClass("DlEntry-empty"),this._isEmpty=!1)}.$(this),blur:this._on_element_blur=function(){this.delClass("DlEntry-Focus"),this._focused=!1,n.BASE.blur.call(this),this.__setEmpty()}.$(this),change:this._on_element_change=function(){this.destroyed||(this.__setEmpty(),this.callHooks("onChange"))}.clearingTimeout(10,this)}),this.addEventListener({onChange:e,onKeyPress:i}),null!=this._value?this.setValue(this._value,!0):this.clear(!0),null!=this._width?t.style.width=this._width:null!=this._size&&this.setSize({x:9*this._size+7-this._size}),null!=this._name&&(t.name=this._name),this.readonly(this._readonly)},t.readonly=function(t){var e=this.getInputElement();return null!=t&&((e.readOnly=t)?e.setAttribute("readonly",!0,1):e.removeAttribute("readonly"),this.condClass(t,"DlEntry-Readonly")),e.getAttribute("readonly")},t.disabled=function(t,e){e=n.BASE.disabled.call(this,t,e);return null!=t&&(this.getInputElement().disabled=!!t),e},t.setSize=t.setOuterSize=function(t){var e=this.getInputElement(),n=t.x,i=t.y,s=r.getPaddingAndBorder(this.getElement()),o=r.getPaddingAndBorder(e),l=this._btn?this._btn.getSize().x:0;l?r.setOuterSize(e,t.x-s.x-o.x-l+2):(null!=n&&(n-=o.x+4),null!=i&&(i-=o.y+4),"textarea"!=this._domType&&(i=null),r.setInnerSize(e,n,i),null!=n&&(n+=8,r.setInnerSize(this.getElement(),n)))},t._makeButton=function(t,e,n,i){i||n||(n="DlEntry-dropDownBtn",i={hover:"DlEntry-dropDownBtn-hover",active:"DlEntry-dropDownBtn-active"});var s=o("td",null,null,this.getElement().rows[0]);return this._btn=new DlAbstractButton({parent:this,appendArgs:s,label:t,iconClass:e,className:n,classes:i})}}),DEFINE_CLASS("DlCompletionEntry",DlEntry,function(n,t,e){n.DEFAULT_EVENTS=["onCompletion","onSelect"],n.DEFAULT_ARGS={__timeout:["timeout",500],_shiftMenu:["shift",null],__smart:["smart",!0],__noTab:["noTab",!1],_noSelect:["noSelect",!0],_sizeToFit:["sizeToFit",!1],_electric:["electric",!0]},t.ALIGN={prefer:"Br",fallX1:"_r",fallX2:"_L",fallY1:"B_",fallY2:"T_"},t._setListeners=function(){this.__on_itemHover=function(t,e){var n=o.children().indexOf(this);n!=l&&null!=l&&o.children(l).callHooks("onMouseLeave");l=n,!t._electric&&e||t._applyCompletion(this.userData)}.$(null,this),this.__on_itemSelect=function(t){t._hideMenu(),t._applyCompletion(this.userData,!0),t.applyHooks("onSelect",[this.userData]),t.focus.delayed(0,t)}.$(null,this),n.BASE._setListeners.call(this),this.addEventListener({onKeyDown:h,onBlur:c,onDestroy:this.__clearTimer})},t._hideMenu=function(){s().hide(50),this.__clearTimer()},t.__clearTimer=function(){this.__timer&&clearTimeout(this.__timer),this.__timer=null};var i=null;function s(){return i=i||DlCompletionPopup.get()}var o=null,l=null;function r(){return o&&o.parent.visible}function a(t,e){this.__origData={value:this.getValue(),range:this.getSelectionRange()},this.__forced=e,this.addClass("DlCompletionEntry-busy"),this.applyHooks("onCompletion",[this.getSelectionRange(),t,e])}function u(t){if(!r())return!1;var e=l;switch(t.keyCode){case DlKeyboard.ARROW_UP:null==l&&(l=0),l=o.children().rotateIndex(--l);break;case DlKeyboard.ARROW_DOWN:case DlKeyboard.TAB:null==l&&(l=-1),l=o.children().rotateIndex(++l);break;case DlKeyboard.ENTER:null!=l&&(this.collapse(!1),o.children(l).callHooks("onSelect")),DlException.stopEventBubbling();case DlKeyboard.ESCAPE:this._hideMenu();var n=this.__origData;n&&(this.setValue(n.value),this.setSelectionRange(n.range)),DlException.stopEventBubbling()}e!=l?(null!=e&&o.children(e).callHooks("onMouseLeave"),o.children(l).callHooks("onMouseEnter"),DlException.stopEventBubbling()):this._hideMenu()}function h(t){if(is_ie)return u.call(this,t)}function c(){this.cancelCompletion()}t._applyCompletion=function(t,e){var n,i,s,o;t.nomodify&&!e||(n=this.getSelectionRange(),i=t.completion||t.label,e&&t.after&&(i+=t.after),o=this.getValue(),s=(null!=t.start?t:n).start,o=o.substr(0,s)+i+o.substr(n.end),this.setValue(o),n.end=s+i.length,null!=t.rstart&&(n.start=t.rstart),(t.noselect||e)&&(n.start=n.end),this.setSelectionRange(n))},t._on_menuHide=function(){o&&(o.destroy(),l=o=null)},t.completionReady=function(t){var n,i;(this.__timer||this.__forced)&&null!=t&&0<t.length&&(this.__smart&&1==t.length?(this._applyCompletion(t[0],!0),this.applyHooks("onSelect",[t[0]])):(o&&(l=null,o.destroy()),n=o=new DlVMenu({}),i=null,t.foreach(function(t){var e=new DlMenuItem({parent:n,label:t.label,data:t});e.addEventListener({onSelect:this.__on_itemSelect,onMouseEnter:this.__on_itemHover}),t.selected&&(i=e)},this),s().popup({timeout:0,content:n,align:this.ALIGN,anchor:this.getElement(),isContext:!0,widget:this,onHide:this._on_menuHide.$(this),shift:this._shiftMenu}),this._sizeToFit&&(t=this.getSize().x,n.getSize().x<t)&&n.setSize({x:t-e.getPaddingAndBorder(s().getElement()).x}),i&&i.callHooks("onMouseEnter"))),this.cancelCompletion()},t.cancelCompletion=function(){this.delClass("DlCompletionEntry-busy"),this.__clearTimer(),this.__forced=null},t._handle_focusKeys=function(t){if(DlKeyboard.KEYS_CONTROL[t.keyCode]){if(!is_ie){if(this.__noTab||t.keyCode!=DlKeyboard.TAB||r()||this.isEmpty())return u.call(this,t);a.call(this,t,!0),t.domStop=!0,DlException.stopEventBubbling()}}else this._hideMenu(),null!=this.__timeout&&(this.__timer=a.delayed(this.__timeout,this,t,!1));return n.BASE._handle_focusKeys.call(this,t)},t.completeFromWords=function(t,e){return n.completeFromWords.call(n,this,t,e)},n.completeFromWords=function(o,l,r){return null==(r=null==r?{}:r).sep&&(r.sep=/\s+/g),function(t){var e=[],n=o.getValue(),i=n.lastIndexOfRegexp(r.sep,t.start);if(n=n.substring(i,t.start))for(var s=0;s<l.length;++s)0==l[s].indexOf(n)&&e.push({label:l[s],noselect:r.noselect,after:r.addSep,start:i});0<e.length?o.completionReady(e):o.cancelCompletion()}}}),DEFINE_CLASS("DlCompletionPopup",DlPopup,function(t,e){t.FIXARGS=function(t){t.zIndex=1e3,t.focusable=!1}}),DEFINE_CLASS("DlComboBox",DlCompletionEntry,function(t,e){t.DEFAULT_ARGS={_noSelect:["noSelect",!1],__smart:["smart",!1],__noTab:["noTab",!0],_options:["options",null],_sizeToFit:["sizeToFit",!0],_electric:["electric",!1]},e._createElement=function(){t.BASE._createElement.apply(this,arguments),this._makeButton(null,null,"DlComboBox-dropDownBtn",{hover:"DlComboBox-dropDownBtn-hover"}).addEventListener("onMouseDown",function(t){0==t.button&&(this._forcePopup(),DlException.stopEventBubbling())}.$(this)),this.addEventListener("onCompletion",this.doCompletion)},e._on_menuHide=function(){t.BASE._on_menuHide.call(this),this._btn.delClass("DlComboBox-dropDownBtn-active")},e._forcePopup=function(){this._btn.addClass("DlComboBox-dropDownBtn-active"),this.__forced=!0,this.doCompletion(null),this.focus.delayed(0,this)},e.doCompletion=function(t){var e="",n=[];if(t&&!(e=this.getValue().trim().toLowerCase()))return this.cancelCompletion();t=this._options;t instanceof Function&&null==(t=t.apply(this,arguments))||(t.foreach(function(t){0==t.toLowerCase().indexOf(e)&&n.push({label:t.htmlEscape(),start:0,completion:t})}),0<n.length?this.completionReady(n):this.cancelCompletion())}}),DEFINE_CLASS("DlDrag",DlEventProxy,function(t,e,s){t.DEFAULT_EVENTS=["onDrop","onStartDrag"],t.DEFAULT_ARGS={delta:["delta",3],dragging:["_dragging",!1],draggingClass:["draggingClass","DlWidget-dragging"],_animArgs:["animation",{length:30,fps:50}],cursor:["cursor",{noDrop:"CURSOR-NO-DROP",okDrop:"CURSOR-DROP"}]},e.dropOK=function(t,e,n,i){return this.target=n,this.canDrop=!0},e._handleDrop=function(t,e,n){this.applyHooks("onDrop",[t,e,n])},e.doDrop=function(t,e){throw new DlExAbstractBaseClass},e.startOK=function(t,e){return!0},e.moving=function(t,e){},e.reset=function(t){var e,n,i=this.elementCopy;i&&i.parentNode&&(t&&this._animArgs?(t=new DlAnimation(this._animArgs.length,this._animArgs.fps),e=this.startElPos||this.startPos,n=s.getPos(i),t.addEventListener({onUpdate:function(){var t=this.getPos();i.style.left=t.mapInt(n.x,e.x)+"px",i.style.top=t.mapInt(n.y,e.y)+"px",s.setOpacity(i,this.t.map(1,.2))},onStop:function(){s.trash(i),i=null}}),t.start(null,null,"accel_ab")):i.parentNode.removeChild(i)),this.dragging=!1,this.canDrop=!1,this.target=null,this.elementCopy=null,this.startPos=null,this.source=null},e.makeElementCopy=function(t,e){var n=this.elementCopy;return n||(n=this.elementCopy=t.getElement().cloneNode(!0),s.addClass(n,"DlWidget-dragged-clone"),n.style.top=e.pos.y+"px",n.style.left=e.pos.x+"px",document.body.appendChild(n),n.style.width=n.offsetWidth+"px"),n}}),DEFINE_CLASS("DlDragTreeItem",DlDrag,function(t,e){t.DEFAULT_ARGS={_noReparent:["noReparent",!1]};var s=/DlTreeItem-dropTarget[^\s]*/g,o=/DlTreeItem-dropTarget-[^\s]*/g;function l(t){return/DlTree-IconWidth/.test(t.target.className)}e.startOK=function(t,e){return!l(e)},e.dropOK=function(t,e,n,i){for(;n&&!(n instanceof DlTreeItem);)n=n.parent;i=(i=!i&&n)&&(!this._noReparent||t.parent===n.parent);return this.target=i?n:null,this.canDrop=!!i,this.oldTarget&&this.oldTarget!==this.target&&this.oldTarget.delClass(s),i&&this.target.addClass("DlTreeItem-dropTarget"),this.oldTarget=this.target,i},e.doDrop=function(t,e){this._noReparent||l(e)?(e=this.target.getIndex(),this.dropBefore||++e,this.target.parent.appendWidget(t,e),this._handleDrop(t,this.target,this.dropBefore?"before":"after")):this.target.getSubtreeWidget()!==t.parent&&(this.target.addSubItem(t),this._handleDrop(t,this.target))},e.moving=function(t,e){var n,i=this.target;this.canDrop&&i&&(this._noReparent||l(e))?(e=e.computePos(i),n=i.getDivElement().offsetHeight/2,e=e.y<=n,i.condClass(e,"DlTreeItem-dropTarget-upper","DlTreeItem-dropTarget-lower"),this.dropBefore=e):i&&(this.dropBefore=null,i.delClass(o))},e.reset=function(){this.target&&this.target.delClass(s),this.oldTarget&&this.oldTarget.delClass(s),t.BASE.reset.apply(this,arguments),this.oldTarget=null}}),DEFINE_CLASS("DlLayout",DlContainer,function(i,t,s){i.DEFAULT_ARGS={_outerSpace:["outerSpace",0],_fillParent:["fillParent",!0]},i.setFill=function(t,e){var n=t._dllayout_args.fill;(t._dllayout_args.fill=e)!=n&&t.parent.doLayout()},i.getArgs=function(t){return t._dllayout_args},t._appendWidgetElement=function(t,e){if(null==e)return i.BASE._appendWidgetElement.apply(this,arguments);var n=s.createElement("div",null,{className:"DlLayout-positioned"},this.getElement());e.zIndex&&(n.style.zIndex=e.zIndex),e.overflow&&(n.style.overflow=e.overflow),n.appendChild(t.getElement()),t._dllayout_args=e},t._removeWidgetElement=function(t){var e;this._widgets.contains(t)&&(e=(t=t.getElement()).parentNode)&&(e.parentNode.removeChild(e),e.removeChild(t))},t.packWidget=function(t,e){this.appendWidget(t,e)},t.doLayout=function(){var n,l,r,a,u=this.getInnerSize(),t=this._outerSpace;function e(){n="number"==typeof t?l=r=a=t:t instanceof Array?(a=t[0],l=t[1],r=t[2],t[3]):(a=t.top||0,l=t.right||0,r=t.bottom||0,t.left||0)}e();for(var i=this._widgets,s=new Array(i.length),o=0;o<i.length;++o){var h=i[o],c=h._dllayout_args;if(c&&h.display()){var d=h.getElement().parentNode,_=c.before=c.before||0,f=c.after=c.after||0,p=c.fill,g=(c.resetSize&&(h.getElement().style.height="",h.getElement().style.width=""),h.getOuterSize());switch(c.pos){case"top":a+=_,null==p&&(p=g.y),s[o]={sy:p},"number"==typeof p&&(a+=p),a+=f;break;case"right":l+=_,null==p&&(p=g.x),s[o]={sx:p},"number"==typeof p&&(l+=p),l+=f;break;case"bottom":r+=_,null==p&&(p=g.y),s[o]={sy:p},"number"==typeof p&&(r+=p),r+=f;break;case"left":n+=_,null==p&&(p=g.x),s[o]={sx:p},"number"==typeof p&&(n+=p),n+=f}s[o].w=h,s[o].args=c,s[o].div=d}}var m=u.x-n-l,y=u.y-a-r;e(),s.foreach(function(i,t){i||$CONTINUE();var s=i.args,o=i.w;if(o.display()){switch(s.pos){case"top":case"bottom":"number"!=typeof i.sy&&("*"==i.sy?i.sy=y:/%/.test(i.sy)&&(i.sy=Math.floor(parseFloat(i.sy)*y/100)),null!=s.min&&i.sy<s.min&&(i.sy=s.min),null!=s.max&&i.sy>s.max&&(i.sy=s.max),y-=i.sy);break;case"left":case"right":"number"!=typeof i.sx&&("*"==i.sx?i.sx=m:/%/.test(i.sx)&&(i.sx=Math.floor(parseFloat(i.sx)*m/100)),null!=s.min&&i.sx<s.min&&(i.sx=s.min),null!=s.max&&i.sx>s.max&&(i.sx=s.max),m-=i.sx)}switch(s.pos){case"top":a+=s.before,i.div.style.left=n+"px",i.div.style.top=a+"px",o.setSize({x:u.x-n-l,y:i.sy}),a+=i.sy+s.after;break;case"bottom":r+=s.before,i.div.style.left=n+"px",i.div.style.top=u.y-r-i.sy+"px",o.setSize({x:u.x-n-l,y:i.sy}),r+=i.sy+s.after;break;case"left":n+=s.before,i.div.style.left=n+"px",e(),n+=i.sx+s.after;break;case"right":l+=s.before,i.div.style.left=u.x-l-i.sx+"px",e(),l+=i.sx+s.after}}function e(){var t=a,e=u.y-a-r,n={x:i.sx};switch(s.valign){case"top":break;case"center":t+=(e-o.getOuterSize().y)/2;break;case"bottom":t+=e-o.getOuterSize().y;default:n.y=e}i.div.style.top=t+"px",o.setSize(n)}})},t.__doLayout=function(){this.doLayout()},t.sizeToFit=function(){for(var t=this._widgets,e=0,n=0,i=0;i<t.length;++i){var s=t[i],o=s._dllayout_args,l=s.getOuterSize();switch(o.pos){case"top":case"bottom":e+=l.y,l.x>n&&(n=l.x);break;case"left":case"right":n+=l.x,l.h>e&&(e=l.h)}}this.setOuterSize({x:n,y:e})}}),DEFINE_CLASS("DlResizeBar",DlWidget,function(t,e,l){t.DEFAULT_EVENTS=["onResizing","onStop"];var n=l.condClass;function i(t){var e=DlElementCache.DRAGGING_LINE,n=this.getPos(),t=(this._dragPos=this.isHoriz()?n.y:n.x,this.isHoriz()?t.pos.y:t.pos.x),t=(this._mposDiff=t-this._dragPos,this.getSize());e.style.top=n.y+"px",e.style.left=n.x+"px",e.style.width=t.x+"px",e.style.height=t.y+"px",this._widget&&(n=this._widget instanceof DlWidget?this._widget.getSize():l.getOuterSize(this._widget),this._dragSize=this.isHoriz()?n.y:n.x),document.body.appendChild(e),this._setResizeCaptures(!0),DlException.stopEventBubbling()}t.FIXARGS=function(t){t.invert=t.invert?-1:1},t.DEFAULT_ARGS={_isHoriz:["horiz",null],_widget:["widget",null],_invert:["invert",!1],_min:["min",null],_max:["max",null],_cont:["continuous",!1],_keepPrc:["keepPercent",!1]},t.getDragBar=function(){return DlElementCache.DRAGGING_LINE},e.initDOM=function(){t.BASE.initDOM.call(this),this.condClass(this.isHoriz(),"DlResizeBar-Horizontal","DlResizeBar-Vertical"),this.setUnselectable(null,!0)},e.isHoriz=function(){var t;return null==this._isHoriz&&(t=DlLayout.getArgs(this))&&(this._isHoriz=/top|bottom/.test(t.pos)),this._isHoriz},e._setListeners=function(){t.BASE._setListeners.call(this),this._resizeHandlers={onMouseMove:function(t){var e,n=DlElementCache.DRAGGING_LINE,i=this.isHoriz()?t.pos.y:t.pos.x,s=(i-=this._mposDiff,this._invert*(i-this._dragPos)),o=this._min,l=this._max,r=this._widget;r&&((r=DlLayout.getArgs(r))&&(null==o&&(o=r.min),null==l)&&(l=r.max),null==o&&null==l||(e=this._dragSize+s),null!=o&&e<o?i+=this._invert*(o-e):null!=l&&l<e&&(i+=this._invert*(l-e)));this.isHoriz()?n.style.top=i+"px":n.style.left=i+"px";this._cont&&this._doResize(t)}.$(this),onMouseUp:function(t){this._setResizeCaptures(!1),this._doResize(t),document.body.removeChild(DlElementCache.DRAGGING_LINE),this.callHooks("onStop")}.$(this),onMouseOver:DlException.stopEventBubbling,onMouseOut:DlException.stopEventBubbling,onMouseEnter:DlException.stopEventBubbling,onMouseLeave:DlException.stopEventBubbling},this.addEventListener("onMouseDown",i)},e._setResizeCaptures=function(t){(t?DlEvent.captureGlobals:DlEvent.releaseGlobals)(this._resizeHandlers);var e=DlDialog.activateEventStopper(t);n(e,t,this.isHoriz()?"CURSOR-RESIZE-S":"CURSOR-RESIZE-E")},e._doResize=function(t){var e,n,i,s=this.isHoriz(),o=l.getPos(DlElementCache.DRAGGING_LINE),o=s?o.y:o.x,s=this._invert*(o-this._dragPos),o=this._widget;o&&(e=this._dragSize,o instanceof DlWidget?(n=DlLayout.getArgs(o))?(n=n.fill,(i=/%$/.test(n))&&!this._keepPrc||null==n||"number"==typeof n?DlLayout.setFill(o,e+s):i&&(n=parseFloat(n),DlLayout.setFill(o,n*(e+s)/e+"%"))):this._isHoriz?o.setSize({y:e+s}):o.setSize({x:e+s}):this._isHoriz?l.setOuterSize(o,null,e+s):l.setOuterSize(o,e+s,null),this.callHooks("onResizing",o))}}),DEFINE_CLASS("DlWM",DlContainer,function(e,t,n){function l(t,e){return t.x<e.x?-1:t.x>e.x?1:0}function r(t,e){return t.y<e.y?-1:t.y>e.y?1:0}function i(t,n){var i=t.length,s=Math.floor(n.x/i),o=0;t.mergeSort(l).foreach(function(t,e){t.y=0,t.x=o,t.h=n.y,t.w=e==i-1?n.x-o:s,o+=s})}function s(t,n){var i=t.length,s=Math.floor(n.y/i),o=0;t.mergeSort(r).foreach(function(t,e){t.x=0,t.y=o,t.w=n.x,t.h=e==i-1?n.y-o:s,o+=s})}t.getInnerSize=t.getOuterSize=t.getSize=function(){return this.parent?this.parent.getInnerSize():n.getWindowSize()},t.initDOM=function(){e.BASE.initDOM.apply(this,arguments),this.getElement().innerHTML="<div class='DlWM-modalStopper'></div>",this.dialogsVisible=[],this.modalsVisible=0,this._manageEvents={onShow:function(t){t.on_dlgShow(this)}.$(null,this),onHide:function(t){t.on_dlgHide(this)}.$(null,this)};var t=this.on_parentResize.$(this);this.parent?this.parent.addEventListener("onResize",t):n.addEvent(window,"resize",t)},t.getModalStopperElement=function(){return this.getElement().childNodes[0]},t.activatePrev=function(){var t=this.dialogsVisible;1<t.length&&(t.peek().deactivate(),t.unshift(t.pop()),t.pop().activate())},t.activateNext=function(){var t=this.dialogsVisible;1<t.length&&t[0].activate()},t.getActiveDialog=function(){return this.dialogsVisible.peek()},t.updateZIndex=function(){this.dialogsVisible.r_foreach(function(t,e){t.zIndex((t.__modal?900:500)+e)})},t.getVisibleDialogs=function(){return this.dialogsVisible},t.getAllDialogs=function(){return this.children().grep(function(t){return t instanceof DlDialog})},t.appendWidget=function(t){e.BASE.appendWidget.apply(this,arguments),t instanceof DlDialog&&this.manage(t)},t.removeWidget=function(t){e.BASE.removeWidget.apply(this,arguments),t instanceof DlDialog&&this.unmanage(t)},t.manage=function(t){t.addEventListener(this._manageEvents)},t.unmanage=function(t){t.removeEventListener(this._manageEvents)},t.on_dlgShow=function(t){t.__modal&&this.modalsVisible++,this.condClass(0<this.modalsVisible,"DlWM-hasModals")},t.on_dlgHide=function(t){t.__modal&&this.modalsVisible--,this.condClass(0<this.modalsVisible,"DlWM-hasModals"),0==this.dialogsVisible.length&&this.parent&&this.parent.focus()},t.on_parentResize=function(){this.dialogsVisible.foreach(function(t){t.__maximized&&t.__doMaximize()}),this.callHooks("onResize")},t.rearrange=function(t){var e=this.dialogsVisible.map(function(t){var e=t.getOffsetPos(),n=t.getOuterSize();return{dlg:t,x:e.x,y:e.y,w:n.x,h:n.y}});t(e,this.getInnerSize()),e.foreach(function(t){t.dlg.setPos(t.x,t.y),t.dlg.setSize({x:t.w,y:t.h})})},t.tileHoriz=function(){this.rearrange(i)},t.tileVert=function(){this.rearrange(s)},DlContainer.prototype._makeWindowManager=function(){return this.__wm||(this.__wm=new DlWM({parent:this})).addEventListener("onDestroy",function(){this.__wm=null}.$(this)),this.__wm}}),DEFINE_CLASS("DlDialog",DlContainer,function(i,t,o){var e,s=DlException.stopEventBubbling,l=o.addClass,n=o.delClass,r=o.condClass,a=o.createElement,u=(i.DEFAULT_EVENTS=["onShow","onHide","onActivate","onQuitBtn"],i.DEFAULT_ARGS={_title:["title","DlDialog"],_noEmptyTitle:["noEmptyTitle",!0],_fixed:["fixed",!1],_resizable:["resizable",!1],_focusable:["focusable",!0],_iconClass:["iconClass",null],_focusedWidget:["focusDefault",null],__noShadows:["noShadows",!1],__quitBtn:["quitBtn",!1],__maxBtn:["maxBtn",!0],__modal:["modal",!1],__moveDelay:["moveDelay",null]},i.FIXARGS=function(t){t.parent||(t.parent=i.getTopWM()),t.parent instanceof DlWM||(t.parent instanceof DlDialog&&(t.noShadows=!0),t.parent=t.parent._makeWindowManager())},i.CONSTRUCT=function(){this.__doDrag=null!=this.__moveDelay?g.clearingTimeout(this.__moveDelay,this):g.$(this),this.active=!1},i.getTopWM=function(){return e||(e=new DlWM({className:"DlTopWindowManager"}),document.body.appendChild(e.getElement())),e},{x:-3e4,y:-3e4});function h(){var t=o.CE_CACHE["DlDialog.EVENT_STOPPER"];return(t=t||(o.CE_CACHE["DlDialog.EVENT_STOPPER"]=a("div",null,{className:"DYNARCH-EVENT-STOPPER"},document.body))).style.visibility="",t}function c(){var t=o.CE_CACHE["DlDialog.EVENT_STOPPER"];return t&&(t.className="DYNARCH-EVENT-STOPPER",t.style.visibility="hidden"),t}function d(t){if(!this.dragging&&!this.__maximized){DlPopup.clearAllPopups(),this.activate(),this.dragging=!0;var e,n,i=(t=t||window.event)instanceof DlEvent?t:new DlEvent(t);if(this.addClass("DlDialog-Dragging"),this._dragPos=i.computePos(this),this._setDragCaptures(!0),l(h(),"CURSOR-DRAGGING"),null!=this.__moveDelay&&(e=this.getResizeRect(),l(e,"Dl-ResizeRect-moving"),n=this.getOuterSize(),o.setPos(e,i.elPos.x,i.elPos.y),o.setOuterSize(e,n.x,n.y),e.style.display=""),i!==t)return o.stopEvent(t)}}function _(t){t.ctrlKey&&(0==t.button&&this._dragHandlers?(d.call(this,t),s()):2==t.button&&this._resizable&&(y.call(this,t),s()))}function f(t){var e;this.dragging&&(e=this.getResizeRect(),this.dragging=!1,this.delClass("DlDialog-Dragging"),this._setDragCaptures(!1),null!=this.__moveDelay&&(t?(t=p.call(this,t),this.__doDrag.doItNow(t.x,t.y)):this.__doDrag.cancel()),n(e,"Dl-ResizeRect-moving"),e.style.display="none",c())}function p(t){var e=this.parent,n=(t.computePos(e.getContentElement()),t.relPos.x-this._dragPos.x),t=t.relPos.y-this._dragPos.y,i=this.getOuterSize(),e=e.getInnerSize();return n<0?n=0:n+i.x>e.x&&(n=e.x-i.x),t<0?t=0:t+i.y>e.y&&(t=e.y-i.y),{x:n,y:t}}function g(t,e){this.setPos(t,e),this.__oldDlgPos=this.getOffsetPos()}function m(t){t=p.call(this,t);null!=this.__moveDelay&&!function(t){var e=t.x,n=t.y;e+=(t=o.getPos(this.parent.getContentElement())).x,n+=t.y,o.setPos(this.getResizeRect(),e,n)}.call(this,t),this.__doDrag(t.x,t.y),s()}function y(t){var e,n,i,s;this.resizing||(this.resizing=!0,e=(t=t||window.event)instanceof DlEvent?t:new DlEvent(t),this._dragPos=e.computePos(this),n=this.getOuterSize(),this._dragPos.x-=n.x,this._dragPos.y-=n.y,i=this.getPos(),s=this.getResizeRect(),o.setPos(s,i.x,i.y),o.setOuterSize(s,n.x,n.y),s.style.display="",this.addClass("DlDialog-Resizing"),this._setResizeCaptures(!0),l(h(),"CURSOR-DRAGGING"),D.call(this,e,!0),e!==t&&o.stopEvent(t))}function D(t,e){var n,i;this.resizing&&(n=this.getResizeRect(),(i=o.getPos(n)).x=t.pos.x-this._dragPos.x-i.x-2,i.x<100&&(i.x=100),i.y=t.pos.y-this._dragPos.y-i.y-2,i.y<100&&(i.y=100),1===this._resizable&&(i.y=null),2===this._resizable&&(i.x=null),o.setInnerSize(n,i.x,i.y),e||s())}function E(t,e){var n=DlSystem();t?(this.callHooks("onShow"),this.activate(),this.setModal(this.__modal,!0),n.applyHooks("on-dialog-show",[this]),this.__maximized&&this.__doMaximize.delayed(1,this)):((t=this.parent.getVisibleDialogs()).remove(this),this.callHooks("onHide"),this.deactivate(),n.applyHooks("on-dialog-hide",[this]),1<=t.length&&t.peek().activate())}function v(t){var e;(t.shiftKey||t.altKey)&&(null==(e=this.__dlgOpacity)&&(e=100),0<t.wheelDelta?e+=.05:e-=.05,e=this.__dlgOpacity=e.limit(.1,1),this.opacity(e),s())}function C(t,e){t=t.getRelElement().childNodes;return t[t.length-e]}t._setDragCaptures=function(t){DlEvent[t?"captureGlobals":"releaseGlobals"](this._dragHandlers)},t._setResizeCaptures=function(t){DlEvent[t?"captureGlobals":"releaseGlobals"](this._resizeHandlers)},i.activateEventStopper=function(t){return(t?h:c)()},t.setOuterSize=t.setSize=function(t){null!=(t=Object.makeCopy(t)).y&&(t.y-=this.getTitleElement().offsetHeight),this.setInnerSize(t)},t.hide=function(){this.display()&&o.elementIsVisible(this.getElement())&&(this.__oldDlgPos=this.getOffsetPos(),this.display(!1),this.setPos(u))},t.show=function(t){this.__wasDisplayed||this.setStyle({visibility:""}),this.display()&&this.__wasDisplayed?this.activate():(this.__oldDlgPos?this.setPos(this.__oldDlgPos):t&&this.centerOnParent(),this.display(!0)),this.__wasDisplayed=!0},t.activate=function(){var t=this.parent.getVisibleDialogs(),e=t.peek();this.active||(e&&e.active&&e.deactivate(!0),this.addClass("DlDialog-Active"),t.remove(this),t.push(this),this.parent.updateZIndex(),this.active=!0,this.focus(),this._focusedWidget&&!this._focusedWidget.destroyed&&this._focusedWidget.focus(),this.applyHooks("onActivate",[!0]))},t.deactivate=function(){this.active&&(this.delClass("DlDialog-Active"),this.active=!1,this.blur(),this.applyHooks("onActivate",[!1]))},t._createElement=function(){i.BASE._createElement.call(this),this.setPos(u),this.setStyle({visibility:"hidden"}),this.getElement().innerHTML="<div class='DlDialog-Rel'><div class='DlDialog-WindowButtons'></div><div class='DlDialog-Title'><div></div></div><div class='DlDialog-Content'></div></div>";var t,e=this.getRelElement(),e=(this.__noShadows&&(this.__noShadows=!0,l(e,"DlDialog-noShadows")),this.title(this._title),this.setUnselectable(this.getTitleElement()),this.__quitBtn);e&&(t=this.__quitBtn=new DlAbstractButton({parent:this,className:"DlDialog-QuitBtn",appendArgs:this.getButtonsElement(),classes:{hover:"DlDialog-QuitBtn-hover",active:"DlDialog-QuitBtn-active"}}),"destroy"==e?e=this.destroy.$(this):"hide"==e&&(e=this.hide.$(this)),e instanceof Function?t.addEventListener("onClick",e):t.connectEvents("onClick",this,"onQuitBtn")),this._resizable&&this.makeResizable(),this.setIconClass(this._iconClass),this._fixed||this.makeDraggable(),this.addEventListener({onMouseDown:this.activate,onMouseWheel:v,onDisplay:E,onDestroy:this.hide})},t.setIconClass=function(t){var e=this.getTitleElement().firstChild;r(e,null!=t,"DlDialog-Title-withIcon"),this.iconClass&&n(e,this.iconClass),t&&l(e,t),this.iconClass=t},t.getState=function(){var t=this.__maximized&&this.__maximizeSavePos;return(t=t?Object.makeDeepCopy(t):{pos:this.getOffsetPos(),size:this.getOuterSize()}).max=!!this.__maximized,t},t.maximize=function(t){var e,n;null==t&&(t=this.__maxBtn.checked()),(this.__maximized=t)&&(e=this.getOffsetPos(),n=this.getOuterSize(),this.__maximizeSavePos={pos:e,size:n}),this.condClass(t,"DlDialog-Maximized"),t?this.__doMaximize():(n=(e=this.__maximizeSavePos).size,e=e.pos,this.setOuterSize({x:n.x,y:n.y}),this.setPos(e.x,e.y)),this.__maxBtn.checked(t,!0),this._focusedWidget&&!this._focusedWidget.destroyed&&this._focusedWidget.focus()},t.__doMaximize=function(){this.setPos(0,0);var t=this.parent.getInnerSize();this.setOuterSize({x:t.x,y:t.y})},t.setModal=function(t,e){e||(this.__modal=t),this.display()&&this.parent.updateZIndex()},t.modal=function(){return this.__modal},t.makeResizable=function(){var t,e;this._resizeHandlers||(this.getContentElement().style.overflow="hidden",t=this.getRelElement(),e=a("div",null,{className:"ResizeHandle"},null),t.insertBefore(e,t.firstChild),this._resizeHandlers={onMouseMove:D.$(this),onMouseUp:function(t){var e,n;this.resizing&&(this.disableHooks("onResize"),this.getElement().style.overflow="hidden",e=this.getResizeRect(),n=o.getOuterSize(e),o.setPos(e,0,0),e.style.display="none",this.delClass("DlDialog-Resizing"),this.setOuterSize({x:n.x-2,y:n.y-2}),is_gecko&&i.BASE.setOuterSize.call(this,{x:"auto",y:"auto"}),this.resizing=!1,this._setResizeCaptures(!1),this.getElement().style.overflow="",c(),this.enableHooks("onResize"),this.callHooks("onResize"))}.$(this),onMouseOver:s,onMouseOut:s,onMouseEnter:s,onMouseLeave:s},o.addEvent(e,"mousedown",y.$(this)),this.resizing=!1,this.__maxBtn&&(this.__maxBtn=new DlAbstractButton({parent:this,className:"DlDialog-MaximizeBtn",appendArgs:this.getButtonsElement(),type:DlAbstractButton.TYPE.TWOSTATE,classes:{hover:"DlDialog-MaximizeBtn-hover",active:"DlDialog-MaximizeBtn-active",checked:"DlDialog-MaximizeBtn-1"}}),this.__maxBtn.addEventListener("onChange",this.maximize.$0(this,null))))},t.makeDraggable=function(t){t||((t=this.getTitleElement()).style.cursor="default",this.addEventListener(["onMouseDown","onContextMenu"],_)),this._dragHandlers||(this._dragHandlers={onMouseMove:m.$(this),onMouseUp:f.$(this),onMouseOver:s,onMouseOut:s,onMouseEnter:s,onMouseLeave:s},this.dragging=!1),o.addEvent(t,"mousedown",d.$(this))},t.title=function(t){return null!=t&&(t instanceof Array&&(t=t.join("")),this._title=t,this.getTitleElement().firstChild.innerHTML=t,this._noEmptyTitle)&&(this.getTitleElement().style.display=/\S/.test(t)?"":"none"),this._title},t._handle_focusKeys=function(t){var e;t.altKey||t.ctrlKey||(t.keyCode==DlKeyboard.ESCAPE?!this.dragging&&this.__quitBtn?this.__quitBtn.keyClicked(t):this.dragging&&f.call(this):t.keyCode==DlKeyboard.TAB&&(e=t.focusedWidget,(e=t.shiftKey?this.getPrevFocusWidget(e):this.getNextFocusWidget(e))&&e.focus(),t.domStop=!0,s())),this._handleKeybinding(t)},t.getRelElement=function(){return this.getElement().firstChild},t.getContentElement=function(){return C(this,1)},t.getTitleElement=function(){return C(this,2)},t.getButtonsElement=function(){return C(this,3)},t.centerOnParent=function(){var t=this.getOuterSize(),e=this.parent.getOuterSize();this.setPos((e.x-t.x)/2,(e.y-t.y)/2)},t.getWM=function(){return this.parent},DlWidget.prototype.getParentDialog=function(){for(var t=this.parent;t&&!(t instanceof i);)t=t.parent;return t}}),DEFINE_CLASS("DlDialogPopup",DlPopup,function(t,e){t.FIXARGS=function(t){t.autolink=!1,t.zIndex=5e3}}),DEFINE_CLASS("DlRecord",DlEventProxy,function(t,e){t.DEFAULT_EVENTS=["onChange"],t.DEFAULT_ARGS={_data:["data",null],_set:["recordSet",null]},e.id=function(){return this._data.id},e.get=function(t){return this._data[t]},e.set=function(t,e,n){var i=this._data[t];this._data[t]=e,n||(this.applyHooks("onChange",n=[this,t,e,i]),this._set&&this._set.applyHooks("onChange",n))},e.compareTo=function(t,e){var n=this.get(e),t=t.get(e);return n<t?-1:n==t?0:1}}),DEFINE_CLASS("DlRecordCache",DlEventProxy,function(t,e){t.DEFAULT_EVENTS=["onChange","onInsert","onBeforeDelete","onDelete","onRefresh"],t.DEFAULT_ARGS={_data:["data",null]},t.CONSTRUCT=function(){this._init()},e.get=function(t){return this._data[t]},e.hasRecord=function(t){return this.get(t)},e.getRecords=function(t,e,n){e.call(n,t.map(this.get,this))},e.getAllIds=function(){return Array.hashKeys(this._data)},e.getAllRecords=function(){return Array.hashValues(this._data)},e.getHash=function(){return this._data},e.formatHTML=function(t,e,n,i){i=i?i.format(t,this):null;n(i=null==i?String(t.get(e)).htmlEscape():i)},e.getRecClass=function(t){},e.getCellClass=function(t,e){},e.getInsertPos=function(t){},e.insert=function(t,e){null==e&&(e=this.getInsertPos(t)),((this._data[t.id()]=t)._set=this).applyHooks("onInsert",[t,e])},e.remove=function(t){this.applyHooks("onBeforeDelete",[this.get(t)]),t instanceof Array?t.foreach(function(t){delete this._data[t]},this):delete this._data[t],this.applyHooks("onDelete",[t])},e.sort=function(t,n,e,i,s,o){e=n==e&&null!==i?t.reverse():t.mergeSort(function(t,e){return t=this.get(t),e=this.get(e),t.compareTo(e,n)}.$(this),i);s.call(o,e)},e._init=function(){var e;this._data?(e={},this._data.foreach(function(t){(e[t.id()]=t)._set=this},this),this._data=e):this._data={}}}),DEFINE_CLASS("DlDataGridHeadLabel",DlButton,function(t,e,i){t.FIXARGS=function(t){"contextMenu"in t||(t.contextMenu=this._getContextMenu)},t.CONSTRUCT=function(){var t;this.isSortable()||((t=this._classes=Object.makeCopy(this._classes)).active=t.hover=null)};var s=20,o=(e.setWidth=function(t){this.setOuterSize({x:t})},e.isSortable=function(){return this.col.isSortable()},e._onClick=function(){this.isSortable()&&this.parent._onHeadClick(this.col,this)},e._getContextMenu=function(){var n,i=this._dgContextMenu,t=this.parent;return i?(n=i.buttons,t._cols.foreach(function(t,e){n[e].checked(t.isVisible(),!0)})):(this._dgContextMenu=i=new DlVMenu({}),n=i.buttons=[],t._cols.foreach(function(t,e){t.getMenuLabel()&&(n[e]=new DlCheckbox({parent:i,label:t.getMenuLabel(),checked:t.isVisible()})).addEventListener("onChange",function(){t.setVisible(this.checked())})})),i},t.DEFAULT_ARGS={col:["col",null],_focusable:["focusable",!1],_noCapture:["noCapture",!0],_classes:["classes",{active:"DlDataGridHeadLabel-active",hover:"DlDataGridHeadLabel-hover",checked:"DlDataGridHeadLabel-1",unchecked:"DlDataGridHeadLabel-0",empty:"DlDataGridHeadLabel-empty",disabled:"DlDataGridHeadLabel-disabled"}]},DlException.stopEventBubbling);function l(t){var e=t._resizeHandle;return e||((e=t._resizeHandle=new DlWidget({parent:t,className:"DlDataGrid-resizeHandle"})).display(!1),e.grid=t.parent,e.addEventListener({onMouseLeave:e.display.$(e,!1),onMouseDown:n}),e._resizeCaptures={onMouseMove:function(t){var e=DlResizeBar.getDragBar(),t=this.pos+t.pos.x-this.origM-1,n=t-this.pos,i=this.origW+n;i<s&&(t+=s-i,i=s);t-=this.sl,e.style.left=t+"px",this.width=i,this.diff=n,is_ie||((e=this.col._button.getElement()).style.width=e.parentNode.style.width=e.parentNode.parentNode.style.width=i+"px");o()}.$(e),onMouseUp:function(t){this.dragging=!1,this.grid.getElement().removeChild(DlResizeBar.getDragBar());var e=DlDialog.activateEventStopper(!1);i.delClass(e,"CURSOR-RESIZE-E"),DlEvent.releaseGlobals(this._resizeCaptures),this.width&&(this.grid.setColWidth(this.col,this.width),this.grid._computeColPos());this.col._button.delClass("DlDataGridHeadLabel-resizing"),is_ie||((e=this.col._button.getElement()).style.width=e.parentNode.style.width=e.parentNode.parentNode.style.width="");this.width=this.diff=this.found=this.col=null,this.parent.callHooks("onMouseMove",t),o()}.$(e),onMouseOver:o,onMouseOut:o,onMouseEnter:o,onMouseLeave:o}),e}function n(t){this.dragging=!0;var e=DlResizeBar.getDragBar(),n=e.style,n=(this.sl=this.grid.getBodyDiv().scrollLeft,n.left=this.pos-this.sl-1+"px",n.height="100%",n.width=this.getElement().offsetWidth-4+"px",n.top="0px",this.grid.getElement().appendChild(e),DlDialog.activateEventStopper(!0));i.addClass(n,"CURSOR-RESIZE-E"),DlEvent.captureGlobals(this._resizeCaptures),this.origW=this.grid.getColWidth(this.col),this.origM=t.pos.x,this.col._button.addClass("DlDataGridHeadLabel-resizing"),o()}t._on_headMouseMove=function(t){var e,n,i;this._colPos&&!this.dragging&&(e=this.parent.getBodyDiv().scrollLeft,n=t.computePos(this).x+e,this._colPos.foreach(function(t){Math.abs(n-t.pos)<4&&(t.col.isResizable()&&(i=t),$BREAK())}),t=l(this),i?(i.col!==t.col&&(t.found=i,t.col=i.col,t.pos=i.pos,t.setPos(i.pos-e)),t.display(!0)):(t.display(!1),t.found=t.col=null))},t._on_headMouseLeave=function(t){l(this).display(!1)}}),DEFINE_CLASS("DlGridCol",DlEventProxy,function(t,e){t.DEFAULT_EVENTS=["onChange","onVisibility"],t.DEFAULT_ARGS={_field_id:["id",null],_width:["width",null],_fill:["fill",null],_style:["style",null],_label:["label",null],_menuLabel:["menuLabel",null],_tooltip:["tooltip",null],_iconClass:["iconClass",null],_isSortable:["sortable",!0],_isResizable:["resizable",!0],_cssRule:["cssRule",null],_isVisible:["visible",!0],_format:["format",null]};var n={};e.id=function(){return this._field_id},e.getWidth=function(){return this._width},e.getFill=function(){return this._fill},e.getLabel=function(){return this._label},e.getMenuLabel=function(){return this._menuLabel||this._label},e.getTooltip=function(){return this._tooltip},e.getIconClass=function(){return this._iconClass},e.getStyle=function(t,e){return(this._style||n)[t]||e},e.isSortable=function(){return this._isSortable},e.isResizable=function(){return this._isResizable},e.isVisible=function(){return this._isVisible},e.setVisible=function(t){this._isVisible=t,this.applyHooks("onVisibility",[t])},e.sort=function(){},e.format=function(t,e){if(this._format)return this._format(t,e,this.id())}}),DEFINE_CLASS("DlGridDragCol",DlDrag,function(t,e,l){var r;t.CONSTRUCT=function(){this.addEventListener("onStartDrag",function(t){this.grid_pos=t.parent.getPos(),t._onMouseLeave()})},e.startOK=function(t,e){return!0},e.dropOK=function(t,e,n,i){return!i&&n instanceof DlDataGridHeadLabel&&t.parent===n.parent?(this.target=n,this.canDrop=!0):this.canDrop=!1},e.doDrop=function(t,e){t.parent.reorderColumn(t.col,this.target.col,!this.dropBefore)},e.moving=function(t,e){var n,i,s=this.target,o=(r||(r=l.createElement("div",{display:"none"},{className:"DlDataGrid-drop-col"},document.body))).style;this.canDrop&&s?(e=e.computePos(s),n=s.getElement().offsetWidth,n=e.x<=n/2,i=s.col.index,n&&i--,i=i<0?0:t.parent._headCont._colPos[i].pos-t.parent.getBodyDiv().scrollLeft,o.display="block",o.left=i+this.grid_pos.x+"px",o.top=e.elPos.y+"px",this.dropBefore=n):s&&(this.dropBefore=null,o.display="none")},e.reset=function(){r&&(r.style.display="none"),t.BASE.reset.apply(this,arguments)}}),DEFINE_CLASS("DlSelectionModel",DlEventProxy,function(t,e){t.DEFAULT_EVENTS=["onChange","onReset"],t.CONSTRUCT=function(){this.sel||(this.sel={})},t.DEFAULT_ARGS={multiple:["multiple",!0],sel:["sel",null]},e.reset=function(t,e){var n=this.sel;this.sel=t.toHash(!0),e||this.applyHooks("onReset",[n,this.sel])},e.clear=function(t){this.reset([],t)},e.get=function(){return this.sel},e.getArray=function(){return Array.hashKeys(this.sel)},e.getFirst=function(){for(var t in this.sel)return t},e.isSelected=function(t){return this.sel[t]},e.size=function(){var t,e=0;for(t in this.sel)e++;return e},e.filter=function(t){var e,n=[];for(e in this.sel)e in t||n.push(e);this.unselect(n)},e.select=function(t,e){var n,i=this.sel,s=null;return t instanceof Array?(n={},t.foreach(function(t){i[t]||(i[t]=n[t]=!0,s=!0)},this),e||null==s||this.applyHooks("onReset",[{},n])):i[t]||(i[t]=!0,e||this.applyHooks("onChange",[t,!0]),s=!0),s},e.unselect=function(t,e){var n,i=this.sel,s=null;return t instanceof Array?(n={},t.foreach(function(t){i[t]&&(delete i[t],s=!(n[t]=!0))},this),e||null==s||this.applyHooks("onReset",[n,{}])):i[t]&&(delete i[t],e||this.applyHooks("onChange",[t,!1]),s=!1),s},e.toggle=function(t,e){return this.sel[t]?this.unselect(t,e):this.select(t,e)}}),DEFINE_CLASS("DlDataGrid",DlContainer,function(r,t,c){var s=c.addClass,o=c.delClass,n=c.condClass,a=(r.DEFAULT_EVENTS=["onBodyDblClick","onBodyScroll","onRowClick","onRowDblClick","onResetIds"],r.CONSTRUCT=function(){this.__scrollConts=0},DlException.stopEventBubbling),e=(r.DEFAULT_ARGS={_records:["records",null],_selection:["selection",null],_data:["data",null],_page:["page",0],_rpp:["rpp",60],_minReqRows:["minReq",null],_threshold:["threshold",null],_vScroll:["virtualScrolling",!0],_cols:["cols",null],_headType:["headType",DlDataGridHeadLabel],_focusable:["focusable",!0],_rtClickKeepSel:["rightClickKeepsSel",!1],_noReselect:["noReselect",!1],_rarify:["rarifyScroll",null]},String.buffer("<div class='DlDataGrid-Headers'>","<table class='DlDataGrid-rowTable' cellspacing='0' cellpadding='0'>","<tbody><tr></tr></tbody>","</table></div>","<div class='DlDataGrid-Body'>","<div class='DlDataGrid-VSHeight'>","<div class='DlDataGrid-VSHeight-before'></div>","<div class='DlDataGrid-RowsCont'></div>","</div>","</div>").get());function i(t){var e,n,i,s,o,l=t.target;try{for(;l&&l.tagName;){if("div"==(o=l.tagName.toLowerCase())&&null!=(i=l.getAttribute("recid"))){e=l;break}s||"td"!=o||(s=(n=l).getAttribute("colid")),l=l.parentNode}}catch(t){}return e?{row:e,col:n,id:i,col_id:s}:null}function l(){var t,r,e,a,u,l,n,h;this._processing_scroll||(this._processing_scroll=!0,t=(e=this.getBodyDiv()).scrollTop,this.getHeaderTable().style.marginLeft=-e.scrollLeft+"px",this._vScroll&&this._records&&t!=this._oldScroll&&(r=this.getRowsContainer(),e=this._records.array,a=this._info_display,u=(h=this.getBoundRecords()).first,l=h.last,h=h.h,u>=a.first_row_index&&l<=a.last_row_index||(l<a.first_row_index||u>a.last_row_index?(n=e.slice(u,u+this._rpp),this._display_ids(n,h*u)):u<a.first_row_index?(n=e.slice(u,a.first_row_index),this.__scrollConts++,this.__cont=function(t){var e,n=String.buffer("<div>"),i=t.length,t=(t.foreach(this._fetchRowHTML.$(this,n)),n("</div>"),n.get()),s=c.createFromHtml(t);try{var o=document.createRange(),l=r.childNodes;o.selectNodeContents(s),e=o.extractContents(),o.detach(),(o=document.createRange()).setStartBefore(l[l.length-i]),o.setEndAfter(l[l.length-1]),o.deleteContents()}catch(t){for(e=e||document.createDocumentFragment();s.firstChild;)r.removeChild(r.lastChild),e.appendChild(s.firstChild)}r.insertBefore(e,r.firstChild),this._setVScroll(h*u),a.first_row_index=u,a.last_row_index-=i},this._fetch_data(n,-1,function(t){this.__scrollConts--,0==this.__scrollConts&&this.__cont(t)})):l>a.last_row_index&&(n=e.slice(a.last_row_index+1,l+1),this.__scrollConts++,this.__cont=function(t){var e,n=String.buffer("<div>"),i=t.length,t=(t.foreach(this._fetchRowHTML.$(this,n)),n("</div>"),n.get()),s=c.createFromHtml(t);try{var o=document.createRange();o.selectNodeContents(s),e=o.extractContents(),o.detach(),(o=document.createRange()).setStartBefore(r.firstChild),o.setEndBefore(r.childNodes[i]),o.deleteContents()}catch(t){for(e=e||document.createDocumentFragment();s.firstChild;)r.removeChild(r.firstChild),e.appendChild(s.firstChild)}r.appendChild(e),this._setVScroll(this._getVSScrollDiv().offsetHeight+h*i),a.first_row_index+=i,a.last_row_index=l},this._fetch_data(n,1,function(t){this.__scrollConts--,0==this.__scrollConts&&this.__cont(t)}))),this._oldScroll=t),this.callHooks("onBodyScroll"),this._processing_scroll=!1)}t.getHeaderDiv=function(){return this.getElement().firstChild},t.getHeaderTable=function(){return this.getHeaderDiv().firstChild},t.getHeaderRow=function(){return this.getHeaderDiv().firstChild.rows[0]},t.getBodyDiv=function(){return this.getElement().childNodes[1]},t._getVSHeightDiv=function(){return this.getBodyDiv().firstChild},t._getVSScrollDiv=function(){return this._getVSHeightDiv().firstChild},t.getRowsContainer=function(){return this._getVSHeightDiv().childNodes[1]},t.resetIDS=function(t){var n={},e=this._selection;t.foreach(function(t,e){n[t]=e}),this._records={array:t,id_to_pos:n},e.filter(n),0==e.getArray().length&&(e._last=null),this.callHooks("onResetIds")},t._fetch_data=function(t,e,n){var i=this._minReqRows,s=t.length,o=this._data;if(null==i||i<=s)o.getRecords(t,n,this);else{var l,r=t.slice(0),a=this._records.array,u=this._threshold||Math.ceil(this._rpp/2);if(e<=0){for(var h=this._records.id_to_pos[t[0]],c=u;0<c--&&o.hasRecord(a[--h]););if(0<c)for(l=h;0<=l&&r.length<i;l--){var d=a[l];o.hasRecord(d)||r.push(d)}}if(0<=e){for(h=this._records.id_to_pos[t.peek()],c=u;0<c--&&o.hasRecord(a[++h]););if(0<c)for(l=h;l<a.length&&r.length<i;l++){d=a[l];o.hasRecord(d)||r.push(d)}}o.getRecords(r,function(t){n.call(this,t.slice(0,s))},this)}},t._display_ids=function(t,n){this._info_display={length:t.length,first_row_index:this._records.id_to_pos[t[0]],last_row_index:this._records.id_to_pos[t.peek()]},this._fetch_data(t,0,function(t){var e=String.buffer();t.foreach(this._fetchRowHTML.$(this,e)),this.getRowsContainer().innerHTML=e.get(),null!=n&&this._setVScroll(n),this._resetVSHeight(),1<t.length?this.scrollToRecord(t[1].id()):this._setVScroll(this.getBodyDiv().scrollTop=0),this.getBoundRecords()})},t.displayPage=function(t){this._page=t=null==t?0:t;var e=this._records.array;this._rpp&&(t=t*this._rpp,e=e.slice(t,t+this._rpp)),this._display_ids(e)},t._resetVSHeight=function(){var t;this._vScroll&&this._info_display&&(t=Math.floor(this.getRowsContainer().offsetHeight*this.getNRecords()/this._info_display.length),this._getVSHeightDiv().style.height=isNaN(t)?"":t+"px")},t._setVScroll=function(t){var e=this._getVSScrollDiv();t?(e.style.height=t+"px",e.style.display="block"):e.style.display="none"},t.initWidths=function(){var e={};this._cols.foreach(function(t){e[t.id()]=this.getColWidth(t)},this);for(var t=this.getRowsContainer().firstChild;t;t=t.nextSibling)for(var n=t.firstChild.rows[0].cells,i=n.length;0<=--i;){var s=n[i],o=s.getAttribute("colid");e[o]=Math.max(e[o]||0,s.offsetWidth)}this._cols.foreach(function(t){this.setColWidth(t,e[t.id()])},this)},t.resetColumns=function(t){var e=this.getHeaderRow(),i=(e.cells,[]),n=(this._cols=t.map(function(t,e){var n=this._colsById[t.id];return i.push(n._cell),n.index=e,n._width=t.width,n._isVisible=t.visible,n},this),document.createDocumentFragment());i.foreach(function(t){n.appendChild(t)}),e.appendChild(n),this.refreshDisplay(),this._cols.foreach(function(t){this.setColVisible(t,t.isVisible()),this.setColWidth(t,t.getWidth())},this)},t.reorderColumn=function(t,e,n){var i=t.index,s=e.index,o=(n&&s++,this._cols);o.splice(i,1),o.splice(i<s?s-1:s,0,t);for(var l=0;l<o.length;++l)o[l].index=l;for(l=this.getRowsContainer().firstChild;l;l=l.nextSibling){t=(r=l.firstChild.rows[0].cells)[i],e=r[s];t.parentNode.insertBefore(t,e||null)}var r,t=(r=this.getHeaderRow().cells)[i],e=r[s];t.parentNode.insertBefore(t,e||null),this._computeColPos()},t.getNRecords=function(){return this._records?this._records.array.length:0},t.getNPages=function(){return this._rpp?Math.ceil(this.getNRecords()/this._rpp):1},t.rec_isSelected=function(t){return this._selection.isSelected(t.id())},t._computeColPos=function(){var e=-1;this._headCont._colPos=this._cols.map(function(t){return{pos:e+=this.getColWidth(t),col:t}},this)},t._createElement=function(){r.BASE._createElement.call(this),this.getElement().id=this.id,this._ss=new DlStyleSheet,this._cssPrefix="#"+this.id,this.setContent(e),this._initHeaders(),this.getBodyDiv().onscroll=this._rarify?l.rarify(this._rarify.calls,this._rarify.timeout,this):l.$(this),(this._headCont=new DlContainer({parent:this,element:this.getHeaderDiv()})).addEventListener({onMouseMove:DlDataGridHeadLabel._on_headMouseMove,onMouseLeave:DlDataGridHeadLabel._on_headMouseLeave,onMouseEnter:this._computeColPos.$(this)}),this._bodyCont=new DlContainer({parent:this,element:this.getBodyDiv(),drag:this._dragArgs}),this._dragArgs=null,"onMouseOver onMouseOut onMouseDown onMouseUp onMouseLeave onDblClick".qw().foreach(function(t){this.addEventListener(t,this["_body_"+t])},this),this._cacheEvents={onChange:this._data_onChange.$(this),onInsert:this._data_onInsert.$(this),onDelete:this._data_onDelete.$(this),onRefresh:this._data_onRefresh.$(this)},this.setCache(this._data),this.addEventListener("onDestroy",this._onDestroy),this._records&&this.resetIDS(this._records),this._sel_events={onChange:this._sel_onChange.$(this),onReset:this._sel_onReset.$(this)},this._selection||(this._selection=new DlSelectionModel({})),this.setSelectionModel(this._selection)},t._onDestroy=function(){this._ss.destroy(),this.setCache(null)},t.setCache=function(t){this._data&&this._data.removeEventListener(this._cacheEvents),(this._data=t)&&t.addEventListener(this._cacheEvents)},t._data_onChange=function(t){var e,n=this.getRowElement(t.id());n&&(e=String.buffer(),this._fetchRowHTML(e,t),e=e.get(),is_ie?n.outerHTML=e:(t=c.createFromHtml(e),c.trash(n.parentNode.replaceChild(t,n))))},t._data_onInsert=function(t,e){var n=this._records.array;null==e&&(e=n.length),n.splice(e,0,t.id()),this.resetIDS(n),this.refreshDisplay()},t._data_onDelete=function(t){var e=this._records.array;t instanceof Array?t.foreach(function(t){this.remove(t)},e):e.remove(t),this.resetIDS(e),this.refreshDisplay()},t._data_onRefresh=function(){},t._recompDynamicWidths=function(){var e=this.getBodyDiv().clientWidth,n=[];this._cols.foreach(function(t){null==t.getFill()?e-=this.getColWidth(t):n.push(t)},this),--e,n.foreach(function(t){this.setColWidth(t,e*t.getFill())},this)},t._initHeaders=function(){this._colsById={},this._cols.foreach(function(t,e){(t=t instanceof DlGridCol?t:this._cols[e]=new DlGridCol(t)).addEventListener("onVisibility",this.setColVisible.$(this,t)),t.index=e;var e="DlDataGrid-col-"+(this._colsById[t.id()]=t).id(),n=(n=this._cssPrefix+" ."+e)+","+n+" .DlDataGrid-cellData",i=[],s=t.getWidth(),s=("number"==typeof s&&i.push("width:"+s+"px"),i=i.join(";"),t._cssRule=this._ss.insertRule(n,i),t.isVisible()||this._ss.modifyRule(t._cssRule,{display:"none"}),t._cell=document.createElement("td")),n=(s.innerHTML="<div class='DlDataGrid-cellData'></div>",s.className=e,this.getHeaderRow().appendChild(s),this._makeHeadLabel({parent:this,appendArgs:s.firstChild,iconClass:t.getIconClass(),label:t.getLabel(),col:t,className:"DlGrid-align-"+t.getStyle("textAlign","left"),tooltip:t.getTooltip.$(t),drag:this._getDragObject()}));t._button=n},this)},t.findRowFromEvent=i,t._sel_onChange=function(t,e){t=this.getRowElement(t);t&&n(t,e,"DlDataGridRow-selected")},t._sel_onReset=function(t,e){var n,i;for(n in t)e[n]||(i=this.getRowElement(n))&&o(i,"DlDataGridRow-selected");for(n in e)t[n]||(i=this.getRowElement(n))&&s(i,"DlDataGridRow-selected")},t.setSelectionModel=function(t){this._selection&&this._selection.removeEventListener(this._sel_events),(this._selection=t).addEventListener(this._sel_events)},t._body_onDblClick=function(t){this.callHooks("onBodyDblClick");t=i(t);t&&this.callHooks("onRowDblClick",t)},t._body_onMouseOver=function(t){t=i(t);t&&this.__tooltip instanceof Function&&(this._tooltipRow=t,DlWidget.getTooltip().popup({timeout:this.__tooltipTimeout,content:this.__tooltip.$(this,t),anchor:this.getElement(),align:"mouse",onPopup:this.__onTooltipShow,onHide:this.__onTooltipHide,widget:this}))},t._body_onMouseOut=function(t){i(t)&&(DlWidget.getTooltip().hide(),this._tooltipRow=null)},t._body_onMouseLeave=function(t){},t.__handleSelectClick=function(t,e){var n,i,s=this._selection,o=this._records;s.multiple?2==e.button?this._rtClickKeepSel||(e.ctrlKey?(this.callHooks("onRowClick",t,e,{rtc:!0,ctrl:!0,type:"select",ids:[t.id]}),s.select([t.id])):s.isSelected(t.id)||(this.callHooks("onRowClick",t,e,{rtc:!0,type:"reset",ids:[t.id]}),s.reset([t.id]))):e.ctrlKey?(this.callHooks("onRowClick",t,e,{ctrl:!0,type:"toggle",ids:[t.id]}),s.toggle(t.id),s._last=t.id):e.shiftKey?null!=s._last?(n=o.id_to_pos[s._last],i=o.id_to_pos[t.id],o=o.array.slice(Math.min(n,i),Math.max(n,i)+1),this.callHooks("onRowClick",t,e,{shift:!0,type:"reset",ids:o}),s.reset(o)):(this.callHooks("onRowClick",t,e,{shift:!0,type:"toggle",ids:[t.id]}),s.toggle(t.id),s._last=t.id):(this.callHooks("onRowClick",t,e,{type:"reset",ids:[t.id]}),s.reset([t.id]),s._last=t.id):this._noReselect&&s.isSelected(t.id)||(this.callHooks("onRowClick",t,e,{type:"reset",ids:[t.id]}),s.reset([t.id]),s._last=t.id)},t._body_onMouseUp=function(t){var e=i(t),n=this.__handleOnMouseUp;e&&n&&e.id==n.id&&this.__handleSelectClick(e,t)},t._body_onMouseDown=function(t){var e=i(t),n=this._selection;e&&(this.__handleOnMouseUp=!n.isSelected(e.id)||!this._bodyCont._dragArgs||t.ctrlKey||t.shiftKey?null:e,this.__handleOnMouseUp||this.__handleSelectClick(e,t),2!=t.button)&&a()},t.scrollToRecord=function(t,e){var n=this.getRowsContainer(),i=Math.floor(n.offsetHeight/n.childNodes.length),s=i*this._records.id_to_pos[t||this._selection._last],o=this.getBodyDiv(),n=o.scrollTop,l=o.clientHeight;if(null==e)s<n?(o.scrollTop=s,this._setVScroll(i*this._info_display.first_row_index)):n+l<s+i&&(o.scrollTop=s+i-l,this._setVScroll(i*this._info_display.first_row_index));else switch(e){case"top":o.scrollTop=s;break;case"bottom":o.scrollTop=s+i-l;break;case"center":o.scrollTop=(2*s+i-l)/2}},t.scrollHome=function(){this.getBodyDiv().scrollTop=0},t.scrollEnd=function(){this.getBodyDiv().scrollTop=this._getVSHeightDiv().offsetHeight},t.scrollPage=function(t){var e=this.getBodyDiv();e.scrollTop+=t*e.clientHeight-20},t._handle_focusKeys=function(t){var e,n,i,s=this._selection,o=t.keyCode,l=(t.charCode,this._records);switch(o){case DlKeyboard.ARROW_DOWN:e=-1,null!=s._last&&(e=l.id_to_pos[s._last]),t.shiftKey&&s.multiple?(n=l.array.slice(e,e+2),s.select(n),s._last=n.peek()):(e=l.array.limitIndex(e+1),i=l.array[e],s.reset([i]),s._last=i),this.scrollToRecord(),a();break;case DlKeyboard.ARROW_UP:e=l.array.length,null!=s._last&&(e=l.id_to_pos[s._last]),t.shiftKey&&s.multiple?(n=l.array.slice(e-1,e),s.select(n),s._last=n.peek()):(e=l.array.limitIndex(e-1),i=l.array[e],s.reset([i]),s._last=i),this.scrollToRecord(),a();break;case DlKeyboard.HOME:this.scrollHome(),a();break;case DlKeyboard.END:this.scrollEnd(),a();break;case DlKeyboard.PAGE_UP:this.scrollPage(-1),a();break;case DlKeyboard.PAGE_DOWN:this.scrollPage(1),a()}r.BASE._handle_focusKeys.call(this,t)},t._makeHeadLabel=function(t){return new this._headType(t)},t._onHeadClick=function(t,e){var n,i;t.isSortable()&&(i=null,(t=t.id())==(n=this.__sortCol||null)&&(i=!0,this.__sortRev)&&(i=!i),this.__sortRev=i,this.sort(this._records.array,t,n,i,this._handleSort.$(this,t,i)))},t.sort=function(){this._data.sort.apply(this._data,arguments)},t._handleSort=function(t,e,n){this.resetIDS(n),this.refreshDisplay(),this.setSortColumn(t,e)},t.setSortColumn=function(t,e){var n=this.__sortCol;n&&(n=this._colsById[n])._button.delClass(/DlDataGridHeadLabel-sort-[^\s]+/g),(this.__sortCol=t)&&this._colsById[t]._button.condClass(e,"DlDataGridHeadLabel-sort-down","DlDataGridHeadLabel-sort-up")},t.getSortColumn=function(){return this.__sortCol},t.getSortReverse=function(){return this.__sortRev},t.getCol=function(t){return t=t instanceof DlGridCol?t:this._colsById[t]},t.getRec=function(t){return t=t instanceof DlRecord?t:this._data.get(t)},t.setColWidth=function(t,e){(t=this.getCol(t))._width=e,this._ss.modifyRule(t._cssRule,{width:e+"px"})},t.setColVisible=function(t,e){t=this.getCol(t),this._ss.modifyRule(t._cssRule,{display:e?"":"none"}),t._isVisible=!!e},t.getColWidth=function(t){return t=this.getCol(t),this.getHeaderRow().cells[t.index].offsetWidth},t._getDragObject=function(){return this.__drag||(this.__drag=new DlGridDragCol({})),this.__drag},t._fetchRowContentHTML=function(t,e){t("<table class='DlDataGrid-rowTable' cellspacing='0' cellpadding='0'><tr>");for(var n,i,s=this._cols,o=s.length,l=this._data,r=0;r<o;++r)t("<td colid='",i=(n=s[r]).id(),"' class='DlDataGrid-col-",i),(i=l.getCellClass(e,n.id()))&&t(" ",i),t("'>"),is_ie&&t("<div class='DlDataGrid-cellData'>"),l.formatHTML(e,n.id(),t,n),is_ie&&t("</div>"),t("</td>");t("</tr></table>")},t._fetchRowHTML=function(t,e){var n="DlDataGrid-row",i=this._data.getRecClass(e);i&&(n+=" "+i),this.rec_isSelected(e)&&(n+=" DlDataGridRow-selected"),t("<div id='",this.id,":",e.id(),"' class='",n,"' recid='",e.id(),"'>"),this._fetchRowContentHTML(t,e),t("</div>")},t.getRowElement=function(t){return document.getElementById(this.id+":"+t)},t.refreshDisplay=function(){this._oldScroll=null;var t,e=this.getBodyDiv(),n=e.scrollTop,i=this.getRowsContainer(),s=this._records.array;this._info_display;this._rpp&&s.length<this._rpp&&this.displayPage(0),this._rpp&&(i=Math.floor(i.offsetHeight/i.childNodes.length),(t=Math.ceil(n/i)-1)<0&&(t=0),Math.floor((n+e.clientHeight)/i)>=s.length&&s.length,n=s.slice(t,t+this._rpp),this._display_ids(n,i*t))},t.__doLayout=function(){var t=this.getInnerSize(),e=this.getBodyDiv(),n=this.getHeaderDiv();c.setOuterSize(e,t.x,t.y-n.offsetHeight),c.setOuterSize(n,t.x,null),this._resetVSHeight(),this._records&&0<this._records.array.length&&(this._oldScroll=null,l.call(this)),this._recompDynamicWidths()},t.getBoundRecords=function(){var t=this.getBodyDiv(),e=t.scrollTop,n=this.getRowsContainer(),i=this._records.array,s=n.offsetHeight;return 0==s?this.__boundRecords:(s=Math.floor(s/n.childNodes.length),(n=Math.ceil(e/s)-1)<0&&(n=0),(e=Math.floor((e+t.clientHeight)/s))>=i.length&&(e=i.length-1),this.__boundRecords={first:n,last:e,count:e-n+1,h:s})}}),DEFINE_CLASS("DlDragDataGrid",DlDrag,function(t,e){e.startOK=function(t,e){for(var n=t.parent,i=!1,s=e.target;s&&s!=t.getElement();){if(s==n._getVSHeightDiv()){i=!0;break}s=s.parentNode}return i&&0<n._selection.getArray().length?this.grid=n:i=!1,i},e.reset=function(){this.grid=null,t.BASE.reset.apply(this,arguments)}}),DEFINE_CLASS("DlDesktop",DlContainer,function(e,t){var n,i;e.DEFAULT_ARGS={_bounds:["bounds",new DlRect(50,30,800,600)]},t._createElement=function(){e.BASE._createElement.call(this);var t=this.getElement();this._bounds.positionDiv(t),document.body.appendChild(t)},is_ie&&(n=Dynarch.ID("IEsux"),i=function(){var t=document.getElementById(n);t||((t=document.createElement("div")).style.position="absolute",t.style.right=t.style.bottom=t.style.width=t.style.height="0px",t.style.zIndex="-100",document.body.appendChild(t)),this.setSize({x:t.offsetLeft,y:t.offsetTop+t.offsetHeight})}),t.fullScreen=function(){var t=this.getElement().style;t.top="0px",t.left="0px",t.width="100%",t.height="100%",t=is_ie?i.$(this):this.callHooks.$(this,"onResize"),DynarchDomUtils.addEvent(window,"resize",t.clearingTimeout(25))}}),DEFINE_CLASS("DlTable",DlContainer,function(e,t,n){var i=n.createElement;e.FIXARGS=function(t){t.tagName="table",this._colSpan=0},e.DEFAULT_ARGS={__cellSpacing:["cellSpacing",null],__cellPadding:["cellPadding",null],__align:["align",null]},t._createElement=function(){e.BASE._createElement.call(this);var t=this.getElement();null!=this.__cellPadding&&(t.cellPadding=this.__cellPadding),null!=this.__cellSpacing&&(t.cellSpacing=this.__cellSpacing),null!=this.__align&&(t.align=this.__align),i("tbody",null,null,t)},t.getContentElement=function(){return this.getElement().firstChild},t.addRow=function(){return new DlTableRow({parent:this})},t.getRow=function(t){return this.children(t)},t.addCell=function(t,e,n){t=new DlTableCell({parent:t}),null!=e&&t.addClass("DlAlign-"+e),null!=n&&(t.getElement().style.verticalAlign=n),e=t.getElement().cellIndex+1;return e>this._colSpan&&(this._colSpan=e),t},t.getColSpan=function(){return this._colSpan},t.setColSpan=function(t){this._colSpan=t},t.addSeparator=function(t){null==t&&(t=this.getColSpan()),i("div",null,{innerHTML:"&nbsp;"},i("td",null,{colSpan:t},i("tr",null,{className:"DlTable-RowSeparator"},this.getContentElement())))}}),DEFINE_CLASS("DlTableRow",DlContainer,function(t,e){t.DEFAULT_ARGS={_tagName:["tagName","tr"]}}),DEFINE_CLASS("DlTableCell",DlContainer,function(t,e){t.DEFAULT_ARGS={_tagName:["tagName","td"]}}),DEFINE_CLASS("DlFieldGrid",DlTable,function(t,e){t.CONSTRUCT=function(){this.__fields={}},e.addField=function(t,e,n){var i=t.widget||new DlEntry(t),s=t.label,o=(e=e||{},s&&(s instanceof DlWidget?s instanceof DlLabel&&s.setWidget(i):s=new DlLabel({label:t.label.makeLabel(),widget:i})),this.addRow()),l=this.addCell(o,"right",t.valign),r=(l.addClass("DlFieldGrid-labelCell"),"top"==t.valign&&s instanceof DlLabel&&(l.getElement().style.paddingTop=t.vtop||"4px"),s&&l.appendWidget(s),e.middleText&&this.addCell(o).setContent(e.middleText),this.addCell(o)),a=(r.appendWidget(i),t.id||t.name);return null!=a&&(this.__fields[a]=i.getWidgetId(),delete t.id),e&&(a=r.getElement(),e.colSpan&&(a.colSpan=e.colSpan),e.rowSpan)&&(a.rowSpan=e.rowSpan),n&&(n.row=o,n.c1=l,n.c2=r,n.label=s,n.entry=i),i},e.getField=function(t){return t?DlWidget.getById(this.__fields[t]):this.__fields},e.setField=function(t,e){this.__fields[t]=e.getWidgetId()},e.getValue=function(){var t,e={};for(t in this.__fields){var n,i=this.getField(t),s=i.getFormValue||i.getValue;s instanceof Function&&(i instanceof DlAbstractButton&&i._checkTwoState(!0)?"boolean"==typeof(n=s.call(i))?e[t]=n:null==n?e[t]=i.checked():i.checked()&&(e[t]=n):e[t]=s.call(i))}return e},e.getValues=e.getValue,e.setValue=function(t){for(var e in t){var n,i=this.getField(e),e=t[e];i&&(n=i.setFormValue||i.setValue)instanceof Function&&(i instanceof DlAbstractButton&&i._checkTwoState(!0)?i.checked("string"==typeof e?"0"!=e:!!e):n.call(i,e))}},e.setValues=e.setValue}),DEFINE_CLASS("DlFieldset",DlContainer,function(t,e,n){t.DEFAULT_ARGS={_label:["label","DlFieldset"]},e._createElement=function(){t.BASE._createElement.call(this),this.getElement().innerHTML=["<span class='DlFieldset-label'>",this._label,"</span>","<div class='DlFieldset-content'></div>"].join("")},e.getContentElement=function(){return this.getElement().childNodes[1]},e.getLabelElement=function(){return this.getElement().firstChild},e.setOuterSize=e.setSize=function(t){var e=n.getPos(this.getLabelElement()),e=n.getPos(this.getContentElement()).y-e.y;n.setOuterSize(this.getElement(),t.x,t.y-e),t=n.getInnerSize(this.getElement()),n.setOuterSize(this.getContentElement(),t.x,t.y),this.callHooks("onResize")}}),!function(){var i={},n={};window.DlSingleton={get:function(t,e){return n[t]||!e&&(n[t]=new i[t])},register:function(t,e,n){i[t]=e,n&&(window[t]=this.get.$C(t))}}}(),DEFINE_SINGLETON("DlFlashUtils",DlEventProxy,function(t,e){t.DEFAULT_EVENTS=["onLoad","onStorageStatus"];var n=is_ie?String.template('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="215" height="138" id="DlFlashUtils-MOVIE" align="middle">','<param name="allowScriptAccess" value="always" />','<param name="movie" value="$url" />','<param name="quality" value="high" />',"</object>"):String.template('<embed id="DlFlashUtils-MOVIE" src="$url" quality="high" bgcolor="#ffffff" width="215" height="138" ','allowScriptAccess="always" ','type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'),i=null;function s(t){var e=null;try{e=t.GetVariable("$version")}catch(t){}return e}window.DlFlashUtils_init=function(t){DlFlashUtils().callHooks("onLoad")},e.init=function(){var t;i||(t=n({url:Dynarch.getFileURL("swf/flash.swf")}),document.write("<div style='position: absolute; z-index: 31000; left: -256px; top: 50%; margin-left: -108px; margin-top: -69px; width: 216px; height: 138px;'>"+t+"</div>"),i=document.getElementById("DlFlashUtils-MOVIE"))},e.getObject=function(){return i},e.display=function(t){i.parentNode.style.left=t?"50%":"-256px"};var o={"ShockwaveFlash.ShockwaveFlash.7":s,"ShockwaveFlash.ShockwaveFlash.6":function(t){var e="Win 6,0,21";try{t.AllowScriptAccess="always",e=s(t)}catch(t){}return e},"ShockwaveFlash.ShockwaveFlash":s},l=(e.isSupported=function(){var t=navigator.plugins;if(t&&t.length){if((t=t["Shockwave Flash"])&&t.description&&/^Shockwave Flash\s+([^\s]+)/i.test(t.description))return 8<=parseFloat(RegExp.$1)}else if(is_ie)for(var e in o)try{var n=new ActiveXObject(e);if(n){var i=o[e](n);if(null!=i)return i=i.split(/\s+/)[1],8<=parseFloat(i)}}catch(t){}return!1},e.loadPolicyFile=function(t){return this.getObject().DlSocket_loadPolicyFile(t)},e.decodeString=function(t){return t.replace(/%22/g,'"').replace(/%5c/g,"\\").replace(/%26/g,"&").replace(/%25/g,"%")}),r=e.decodeObject=function(t){var e,n;if(t instanceof Array)for(e=t.length;0<=--e;)t[e]=r(t[e]);else if("object"==typeof t){if(null==t)return t;for(e in n={},t)n[l(e)]=r(t[e]);t=n}else"string"==typeof t&&(t=l(t));return t}}),DlFlashStore={set:function(t,e){DlFlashUtils().getObject().DlStorage_set(t,e)},get:function(t){return DlFlashUtils().decodeObject(DlFlashUtils().getObject().DlStorage_get(t))},getAllKeys:function(){return DlFlashUtils().decodeObject(DlFlashUtils().getObject().DlStorage_getAllKeys())},remove:function(t){DlFlashUtils().getObject().DlStorage_remove(t)},clear:function(){DlFlashUtils().getObject().DlStorage_clear()},flush:function(t){var e=DlFlashUtils().getObject().DlStorage_flush();return t&&"pending"==e&&DlFlashUtils().display(!0),e},_onStatus:function(t){DlFlashUtils().display(!1),DlFlashUtils().applyHooks("onStorageStatus",[t])}},DEFINE_CLASS("DlGridLayout",DlLayout,function(n,t,e){var i=e.createElement,o=e.addClass,l=(n.DEFAULT_ARGS={__layout:["layout",null],__layoutHTML:["layoutHTML",null],__cellSpacing:["cellSpacing",0],__cellPadding:["cellPadding",1]},["width","padding","paddingLeft","paddingRight","paddingTop","paddingBottom","verticalAlign","textAlign","whiteSpace"]);t._createElement=function(){var e;n.BASE._createElement.call(this),this.__layoutHTML?(this.setContent(this.__layoutHTML),e=this.getElement().getElementsByTagName("table")[0]):(e=i("table",null,{cellSpacing:this.__cellSpacing,cellPadding:this.__cellPadding,className:"DlGridLayout-table"}),i("tbody",null,null,e),this.__layout.foreach(function(t){var i=t.props,s=e.insertRow(-1);i&&i.minHeight&&(o(s,"DlGridLayout-tr-minHeight"),s.minHeight=!0),t.cells.foreach(function(n,t){var e=s.insertCell(-1);0==t&&i&&i.height&&(e.style.height=i.height),n&&(n.colSpan&&(e.colSpan=n.colSpan),n.className&&(e.className=n.className),n.rowSpan&&(e.rowSpan=n.rowSpan),n.minWidth&&o(e,"DlGridLayout-td-minWidth"),n.minHeight&&(e.minHeight=!0,o(e,"DlGridLayout-td-minHeight")),l.r_foreach(function(t){var e=n[t];null!=e&&(this[t]=e)},e.style))})}),this.getElement().appendChild(e)),this.refNode("__table",e)},t._appendWidgetElement=function(t,e){e.inCell?(this.getCellElement(e.row,e.col).appendChild(t.getElement()),t._dllayout_args=e):n.BASE._appendWidgetElement.call(this,t,e)},t._removeWidgetElement=function(t){var e;this._widgets.contains(t)&&(t._dllayout_args.inCell?(e=t.getElement()).parentNode.removeChild(e):n.BASE._removeWidgetElement.call(this,t))},t.getTableElement=function(){return this.__table},t.getCellElement=function(t,e){return this.getTableElement().rows[t].cells[e]},t.doLayout=function(){var t=this.children();2..times(function(r){t.foreach(function(t){var e,n,i,s,o,l=t._dllayout_args;l.inCell||(e=(l=this.getCellElement(l.row,l.col)).offsetLeft,n=l.offsetTop,i=l.offsetWidth,s=l.offsetHeight,0==r?(o=t.getOuterSize(),(l.minHeight||l.parentNode.minHeight)&&s<o.y&&(l.style.height=o.y+"px")):((l=t.getElement().parentNode.style).left=e+"px",l.top=n+"px",t.setOuterSize({x:i,y:s})))},this)},this)},t.showWidgets=function(e){0==arguments.length&&(e=!0),this.children().r_foreach(function(t){t.display(e)})}}),DlHtmlUtils={_blockTags:"body form textarea fieldset ul ol dl dd dt li div blockquote p h1 h2 h3 h4 h5 h6 quote pre table thead tbody tfoot tr td iframe address".hashWords(),_quickTags:"br hr input link meta img".hashWords(),_headingTags:"h1 h2 h3 h4 h5 h6".hashWords(),_descTags:"p blockquote td div li".hashWords(),isBlockElement:function(t){return t&&1==t.nodeType&&t.tagName.toLowerCase()in DlHtmlUtils._blockTags},needsClosingTag:function(t){return t&&1==t.nodeType&&!(t.tagName.toLowerCase()in DlHtmlUtils._quickTags)},htmlEncode:function(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\x22/g,"&quot;").replace(/\u00A0/g,"&#xa0;")},getHTML:function(t,e,u){var n=DlHtmlUtils,h=[],c=0,d=n.needsClosingTag,_=n.htmlEncode,f=n.getInnerText,p=null,g=null,m=null,y=n._descTags,D=n._headingTags,E=0;!function t(e,n){switch(e.nodeType){case 11:n=!1;case 1:var i=e.tagName.toLowerCase();if("DynarchLIB-REMOVE-ME"!=e.className){if(n){var s=!(e.hasChildNodes()||d(e));if("br"==i){if(e.previousSibling&&!e.nextSibling)break;if(E){h[c++]="\n";break}}u&&(null==p&&i in D?(p=f(e),m=0):null==g&&i in y&&(g=f(e))),h[c++]="<",h[c++]=i;for(var o=e.attributes,l=0;l<o.length;++l){var r,a=o.item(l);a.specified&&(r=a.nodeName.toLowerCase(),/^_moz|^_msh/.test(r)||(a="style"!=r?void 0===e[a.nodeName]||"href"==r||"src"==r||/^on/.test(r)?a.nodeValue:e[a.nodeName]:e.style.cssText,/(_moz|^$)/.test(a))||(h[c++]=" "+r+'="'+_(a)+'"'))}h[c++]=s?" />":">"}for("pre"==i&&++E,l=e.firstChild;l;l=l.nextSibling)t(l,!0);"pre"==i&&--E,n&&!s&&(h[c++]="</"+i+">"),0===m&&(m=c)}break;case 3:/^(script|style)$/i.test(e.parentNode.tagName)?0!=e.data.indexOf("/*<![CDATA[*/")?(h[c++]="/*<![CDATA[*/",h[c++]=e.data,h[c++]="/*]]>*/"):h[c++]=e.data:h[c++]=e.data.htmlEscape();break;case 4:case 8:h[c++]="\x3c!--",h[c++]=e.data,h[c++]="--\x3e"}}(t,e);n=h.join("");return u&&(n={title:p,description:g,content:n,contentButTitle:""},m)&&(n.contentButTitle=h.slice(m).join("")),n},getInnerText:function(t){return null!=t.innerText?t.innerText:null!=t.textContent?t.textContent:void 0},getText:function(t){for(var t=t.cloneNode(!0),e=t.getElementsByTagName("*"),n=e.length;0<=--n;){var i,s=e[n];DlHtmlUtils.isBlockElement(s)&&(i=s.ownerDocument.createTextNode(" "),s.insertBefore(i,s.firstChild),s.appendChild(i.cloneNode(!0)))}var o=DlHtmlUtils.getInnerText(t);return DynarchDomUtils.trash(t),o},_can_t_DeleteFull_tags:"td".hashWords(),canDeleteFullNode:function(t){return!(t.toLowerCase()in DlHtmlUtils._can_t_DeleteFull_tags)},_can_t_DeleteContent_tags:"ul ol dd table tr img br hr".hashWords(),canDeleteContent:function(t){return!(t.toLowerCase()in DlHtmlUtils._can_t_DeleteContent_tags)},_can_t_StripNode_tags:"ul ol li dd dt dl img br hr table tr td object applet iframe form textarea".hashWords(),canStripNode:function(t){return!(t.toLowerCase()in DlHtmlUtils._can_t_StripNode_tags)}},DEFINE_CLASS("DlIconListView",DlContainer),DEFINE_CLASS("DlIconListItem",DlAbstractButton,function(t,e){t.DEFAULT_ARGS={__itemSize:["itemSize",{x:100,y:null}],__itemSpacing:["itemSpacing",0],__spaceEvenly:["spaceEvenly",!1],__iconSize:["iconSize",{x:40,y:40}],__iconAbove:["iconAbove",!0],_btnType:["type",DlAbstractButton.TYPE.TWOSTATE],_tagName:["tagName","table"],_classes:["classes",{active:"DlIconListItem-active",hover:"DlIconListItem-hover",checked:"DlIconListItem-1",unchecked:"DlIconListItem-0",empty:"DlIconListItem-empty",disabled:"DlIconListItem-disabled"}],_iconClass:["iconClass",null]};var i=["DlIconListItem-iconCell","DlIconListItem-labelCell"];e._createElement=function(){DlWidget.prototype._createElement.call(this);var t=this.getElement();t.cellSpacing=t.cellPadding=0,this.__spaceEvenly?t.style.margin=this.__itemSpacing+"px":t.style.marginRight=t.style.marginBottom=this.__itemSpacing+"px",t.insertRow(-1).insertCell(-1),t.insertRow(-1).insertCell(-1),t.align="left",this.setIconAbove(this.__iconAbove,!0),this.setIconClass(this._iconClass),this.label(this._label,!0),this.setIconSize(this.__iconSize),this._updateState()},e.setIconClass=function(t){this.getIconCell().className=i[0]+" "+t},e.getIconCell=function(){return this.getElement().rows[this.__iconAbove?0:1].cells[0]},e.getLabelCell=function(){return this.getElement().rows[this.__iconAbove?1:0].cells[0]},e.setIconSize=function(t){DynarchDomUtils.setInnerSize(this.getIconCell(),t.x,t.y),this.__iconSize=t},e.getIconSize=function(){return this.__iconSize},e.setIconAbove=function(t,e){var n=this.getElement().rows;e?(n[0].cells[0].className=i[t?0:1],n[1].cells[0].className=i[t?1:0]):t!==this.__iconAbove&&n[1].parentNode.insertBefore(n[1],n[0]),this.__iconAbove=t},e.label=function(t,e){return null==t||!e&&t===this._label||(this._label=t,this.getLabelCell().innerHTML=String.buffer("<div class='DlIconListItem-labelDiv' style='width:",this.__itemSize.x,"px'>",t,"</div>").get(),this.applyHooks("onUpdateLabel",[this._label])),this._label}}),DlJSON={RE_strings:/(\x22(\\.|[^\x22\\])*\x22|\x27(\\.|[^\x27\\])*\x27)/g,RE_forbid:/([\n;()+=\x2f*-])/g,encode:function(t){var e,n;if(null==t)e="null";else if(t.dynarchlib_toJSON)e=t.dynarchlib_toJSON();else if(t instanceof Array)e="["+t.map(DlJSON.encode).join(",")+"]";else if(t instanceof Date)e=DlJSON.encode(t.toUTCString());else if("object"==typeof t){for(n in e=[],t)e.push(DlJSON.encode(n)+":"+DlJSON.encode(t[n]));e="{"+e.join(",")+"}"}else e="string"==typeof t?'"'+t.replace(/\x5c/g,"\\\\").replace(/\r?\n/g,"\\n").replace(/\t/g,"\\t").replace(/\x22/g,'\\"')+'"':t.toString();return e},encodeIndented:function(t,e){null==e&&(e=2);var s=0;function o(t){return" ".repeat(s*e)+t}return function n(i){var t=null==i?"null":i.dynarchlib_toJSON?i.dynarchlib_toJSON():i instanceof Array?"[ "+i.map(n).join(", ")+" ]":i instanceof Date?n(i.toUTCString()):"object"==typeof i?(++s,t=(t=function(){var t,e=[];for(t in i)e.push(n(t)+" : "+n(i[t]));return e.map(o).join(",\n")+"\n"})(),--s,"{\n"+(t=t)+o("}")):"string"==typeof i?'"'+i.replace(/\x5c/g,"\\\\").replace(/\r?\n/g,"\\n").replace(/\t/g,"\\t").replace(/\x22/g,'\\"')+'"':i.toString();return t}(t)},decode:function(t,e){if(!e){e=(t=t.trim()).replace(DlJSON.RE_strings,"");if(DlJSON.RE_forbid.test(e))throw new DlSecurityException("Character "+RegExp.$1+" not allowed in JSON input!")}try{return Dynarch.evalClean(t)}catch(t){throw new DlDataException("Malformed data in JSON input: "+t)}},domToObject:function(t){for(var e,n,i={},s=String.buffer(),o=t.firstChild;o;o=o.nextSibling)1==o.nodeType?(e=DlJSON.domToObject(o),(n=o.nodeName)in i?(i[n]instanceof Array||(i[n]=[i[n]]),i[n].push(e)):i[n]=e):3==o.nodeType&&s(o.nodeValue);return i.$text=s.get(),i}},{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DASH:45,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,INSERT:45,DELETE:46,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,parseKey:function(t){var e,n={};return t=t.toUpperCase(),(e=/^([a-z]+)\s+\x27(.)\x27$/i.exec(t))?(n[e[1]]=!0,n.key=e[2]):(e=/^([a-z]+)-([a-z]+)\s+\x27(.)\x27$/i.exec(t))?(n[e[1]]=n[e[2]]=!0,n.key=e[3]):(e=/^([a-z]+)-([a-z]+)-([a-z]+)\s+\x27(.)\x27$/i.exec(t))&&(n[e[1]]=n[e[2]]=n[e[3]]=!0,n.key=e[4]),n},checkKey:function(t,e){return(!(e="string"==typeof e?DlKeyboard.parseKey(e):e).CTRL&&!t.ctrlKey||e.CTRL&&t.ctrlKey)&&(!e.ALT&&!t.altKey||e.ALT&&t.altKey)&&(!e.SHIFT&&!t.shiftKey||e.SHIFT&&t.shiftKey)&&t.keyStr.toUpperCase()==e.key.toUpperCase()}});function DlType(t){t&&(this.name=t,DlType.TYPES[t]=this)}function DlConsole(){this._messages=[],DlConsole.INSTANCE=this}DlKeyboard.KEYS_CONTROL=["BACKSPACE","TAB","DELETE","ESCAPE","ENTER","PAGE_UP","PAGE_DOWN","END","HOME","ARROW_LEFT","ARROW_UP","ARROW_RIGHT","ARROW_DOWN"].keys_map(DlKeyboard).toHash(!0),DlKeyboard.KEYS_MOVE=["ARROW_LEFT","ARROW_UP","ARROW_RIGHT","ARROW_DOWN"].keys_map(DlKeyboard).toHash(!0),DlKeyboard.KEYS_MOVE_PREV=["ARROW_LEFT","ARROW_UP"].keys_map(DlKeyboard).toHash(!0),DEFINE_CLASS("DlLabel",DlAbstractButton,function(t,e){t.DEFAULT_ARGS={_activateWidget:["widget",null],_tagName:["tagName","span"]},e._onMouseDown=function(t){var e=this._activateWidget;e&&(e.focus(),t.domStop=!0,DlException.stopEventBubbling())},e.setWidget=function(t){this._activateWidget=t},e.getWidget=function(){return this._activateWidget},e._handle_accessKey=function(t){this._onMouseDown(t)}}),DEFINE_CLASS("DlLiteTree",DlContainer,function(t,e,l){t.DEFAULT_EVENTS="onItemMouseDown onItemDblClick".qw(),t.DEFAULT_ARGS={items:["items",null],sort:["sort",Function.identity],_opt_toggleSelection:["toggleSelection",!1],_focusable:["focusable",!0]},t.FIXARGS=function(t){Object.mergeUndefined(t,{fillParent:!0})},t.CONSTRUCT=function(){this.addEventListener({onMouseDown:this._onMouseDown,onDblClick:this._onDblClick})},e.reset=function(t){this.top_items=this.sort(t),this.setContent(this._buildHTML(this.top_items,0)),this._selection&&this._selection.filter(this._itemsById)},e.setSelectionModel=function(t){this._selection?this._selection.removeEventListener(this._selListeners):this._selListeners||(this._selListeners={onChange:this.$("_on_selChange"),onReset:this.$("_on_selReset")}),(this._selection=t).addEventListener(this._selListeners)},e.isSelected=function(t){return this._selection&&this._selection.isSelected(t)},e.refreshItems=function(t){t.foreach(function(t){var e,n,i=this._getItemElement(t);i&&(e=["item-label"],n=this._itemsById[t],this.isSelected(t)&&e.push("selected"),n.addClassNames(e),i.className=e.join(" "),t=String.buffer("<span class='expander'></span>"),n.formatHTML(t),i.innerHTML=t.get())},this)},e.getItemById=function(t){return this._itemsById[t]},e._buildHTML=function(t,o){if(0==t.length)return"";0==(o=null==o?0:o)&&(this._itemsById={});var l=String.buffer("<ul>");return t.foreach(function(t){var e=t.children(),n=0<e.length,i=(l("<li>"),["item-label"]),s=t.id();t.addClassNames(i),this.isSelected(s)&&i.push("selected"),n&&i.push("expanded"),l("<div id='",this._makeId(s),"' lite-tree-item='",s,"' class='",i.join(" "),"'><span class='expander'></span>"),t.formatHTML(l),l("</div>",this._buildHTML(e,o+1),"</li>"),this._itemsById[t.id()]=t},this),l("</ul>"),l.get()},e._makeId=function(t){return this.id+":"+t},e._findItemFromEvent=function(t){for(var e={},n=t.target;n&&1==n.nodeType;){var i=n.getAttribute("lite-tree-item");if(null!=i)return e.el=n,e.id=i,e.item=this._itemsById[i],e;"expander"==n.className&&(e.expander=n),n=n.parentNode}},e.scrollToRecord=function(t){l.scrollIntoView(this._getItemElement(t))},e._getItemElement=function(t){return document.getElementById(this._makeId(t))},e.__handleSelectClick=function(t,e,n){var i=this._selection,s=this._itemsById[t.id],o=[s,t,e];n?(i&&!i.isSelected(t.id)&&this.canSelectItem(s)&&i.reset([t.id]),this.applyHooks("onItemDblClick",o)):i&&!t.expander&&this.canSelectItem(t.item)?i&&this.canSelectItem(t.item)&&(i.multiple?e.ctrlKey?i.toggle(t.id):i.reset([t.id]):this._opt_toggleSelection&&i.isSelected(t.id)?i.toggle(t.id):i.reset([t.id]),this.applyHooks("onItemMouseDown",o)):((n=t.el.nextSibling)&&(s=l.hasClass(n,"hidden"),l.condClass(n,!s,"hidden"),l.condClass(t.el,s,"expanded","collapsed")),this.applyHooks("onItemMouseDown",o))},e.canSelectItem=function(t){return t.isSelectable()};var i=(new Date).getTime(),s=null;e._onMouseDown=function(t){var e=this._findItemFromEvent(t),n=(new Date).getTime();n-i<Dynarch.dblClickTimeout&&e&&s&&e.id==s.id?this.__handleSelectClick(e,t,!0):e&&(i=n,this.__handleSelectClick(e,t,!1)),s=e},e._on_selChange=function(t,e){l.condClass(this._getItemElement(t),e,"selected")},e._on_selReset=function(t,e){Object.foreach(t,function(t,e){l.delClass(this._getItemElement(e),"selected")},this),Object.foreach(e,function(t,e){l.addClass(this._getItemElement(e),"selected")},this)},t.Item=DEFINE_HIDDEN_CLASS(null,DlEventProxy,function(t,e){t.DEFAULT_ARGS={_name:["name",null],_id:["id",null],_children:["children",null]},t.CONSTRUCT=function(){null==this._children&&(this._children=[])},e.formatHTML=function(t){t(String(this._name).htmlEscape())},e.addClassNames=Function.noop,e.id=function(){return this._id},e.children=function(){return this._children},e.isSelectable=Function.returnTrue})}),DEFINE_CLASS("DlMacBarIcon",DlAbstractButton,function(e,t){e.BEFORE_BASE=function(){this.__currentWidth=this.__minWidth,this.__currentHeight=this.__minHeight,this.__align=this.__align.split(/\s+/).toHash()};function n(){this.__anim.destroy()}e.DEFAULT_ARGS={_classes:["classes",{active:"DlMacBarIcon-active",hover:"DlMacBarIcon-hover",checked:"DlMacBarIcon-1",unchecked:"DlMacBarIcon-0",empty:"DlMacBarIcon-empty",disabled:"DlMacBarIcon-disabled"}],__image:["img",null],__minWidth:["minWidth",32],__minHeight:["minHeight",32],__maxWidth:["maxWidth",64],__maxHeight:["maxHeight",64],__align:["align","bottom"],__tooltipTimeout:["tooltipTimeout",900]},t._createElement=function(){DlWidget.prototype._createElement.call(this),this.setContent(String.buffer("<img src='",this.__image,"' width='",this.__minWidth,"' height='",this.__minHeight," ' />").get())},t.getImgElement=function(){return this.getElement().firstChild},t.flash=function(t){this._onMouseEnter(),this._onMouseLeave.delayed(t||100,this)},t.initDOM=function(){e.BASE.initDOM.call(this),this.addEventListener({onDestroy:n}),this.__anim=new DlAnimation(25,40),this.__anim.addEventListener({onUpdate:function(){var t=this.__anim,e=this.getImgElement(),n=t.getPos(),i=t.getPos(function(t){return 1-Math.cos(2.5*t*Math.PI)/Math.exp(5*t)});e.width=this.__currentWidth=n.mapInt(t.sw,t.ew),e.height=this.__currentHeight=i.mapInt(t.sh,t.eh),t=this.__align,n=this.__minWidth-this.__currentWidth,t.center&&(n/=2);(t.left||t.center)&&(e.style.marginRight=n+"px");(t.right||t.center)&&(e.style.marginLeft=n+"px");n=this.__minHeight-this.__currentHeight,t.middle&&(n/=2);(t.top||t.middle)&&(e.style.marginBottom=n+"px");(t.bottom||t.middle)&&(e.style.marginTop=n+"px")}.$(this),onStart:function(){this.__anim.sw=this.__currentWidth,this.__anim.sh=this.__currentHeight}.$(this)})},t._onMouseEnter=function(){e.BASE._onMouseEnter.apply(this,arguments);var t=this.__anim;t.ew=this.__maxWidth,t.eh=this.__maxHeight,t.start(30,50,DlAnimation.easing.elastic_b)},t._onMouseLeave=function(){e.BASE._onMouseLeave.apply(this,arguments);var t=this.__anim;t.ew=this.__minWidth,t.eh=this.__minHeight,t.start(50,50,DlAnimation.easing.accel_b)}}),DEFINE_CLASS("DlNotebook",DlContainer,function(s,t){var e=["onChange"];t._createElement=function(){s.BASE._createElement.call(this),this.getElement().innerHTML="<div class='TabContent-inner'></div>"},t.appendWidget=function(t,e){t.registerEvents(["onNotebookShow"]),s.BASE.appendWidget.call(this,t);var n=t.getElement(),i=this.getContentElement();null!=e?e=this.__widgetsPosition:this.__widgetsPosition=e,null==e&&(e=this.__widgetsPosition=DynarchDomUtils.getPadding(i).x/2),n.style.position="absolute",n.style.visibility="hidden",n.style.left=n.style.top=e+"px",i.appendChild(n),this._panes.push(t)},t.initDOM=function(){this._panes=[],this._currentPane=null,this.registerEvents(e),s.BASE.initDOM.call(this)},t.getPane=function(t){return this._panes[t]},t.getAllPanes=function(){return this._panes},t.getCurrentPane=function(){return this.getPane(this._currentPane)},t.getCurrentPaneIndex=function(){return this._currentPane},t.length=function(){return this._panes.length},t.showPane=function(t){var e=this._currentPane,n=(null!=e&&(this.getPane(e).visibility(!1),this.getPane(e).setPos({x:-3e4,y:-3e4})),this._currentPane=t,this.getPane(t));return n._dl_notebook_has_size||(n.setSize(this.getInnerSize()),n._dl_notebook_has_size=!0),n.setStyle({left:"",top:""}),n.visibility(!0),t!==e&&this.applyHooks("onChange",[t,e]),n.callHooks("onNotebookShow"),this},t.firstPane=function(){this.showPane(0)},t.lastPane=function(){this.showPane(this.length()-1)},t.nextPane=function(){var t=this._currentPane;return null==t?t=0:++t,t>=this._panes.length&&(t=0),this.showPane(t)},t.prevPane=function(){var t=this._currentPane;return null==t?t=this._panes.length-1:--t,t<0&&(t=this._panes.length-1),this.showPane(t)},t.isFirstPane=function(){return 0==this._currentPane},t.isLastPane=function(){return this._currentPane==this._panes.length-1},t.getContentElement=function(){return this.getElement().firstChild},t.setSize=t.setOuterSize=function(t){s.BASE.setOuterSize.call(this,t);var e=this.getElement(),e=(t=DynarchDomUtils.getInnerSize(e),DynarchDomUtils.setOuterSize(this.getContentElement(),t.x,t.y),e.style.width=e.style.height="",t=DynarchDomUtils.getInnerSize(this.getContentElement()),null==this._currentPane&&this.showPane(0),this.getCurrentPane());this._panes.foreach(function(t){t._dl_notebook_has_size=!1}),e.setSize(t),e._dl_notebook_has_size=!0},t.setIdealSize=function(){var e={x:0,y:0};this._panes.r_foreach(function(t){t=t.getOuterSize();t.x>e.x&&(e.x=t.x),t.y>e.y&&(e.y=t.y)}),this.setInnerSize(e)}}),DEFINE_CLASS("DlProgressBar",DlWidget,function(e,t){var n=DynarchDomUtils.createElement;e.DEFAULT_ARGS={__progress_minVal:["min",0],__progress_maxVal:["max",100],__progress_val:["val",0],__label:["label",null]},t._createElement=function(){e.BASE._createElement.call(this);var t=this.getElement();n("div",null,{className:"DlProgressBar-fill"},t),n("div",null,{className:"DlProgressBar-label",innerHTML:"&nbsp;"},t),this.setLabel(this.__label),this.setValue(this.__progress_val)},t._getLabelElement=function(){return this.getElement().lastChild},t._getFillElement=function(){return this.getElement().firstChild},t.getValue=function(){return this.__progress_val},t.getMaxVal=function(){return this.__progress_maxVal},t.getMinVal=function(){return this.__progress_minVal},t.setValue=function(t){(this.__progress_val=t)>this.__progress_maxVal&&(t=this.__progress_maxVal);var e=this.__progress_maxVal-this.__progress_minVal,t=100*(t-this.__progress_minVal)/e;!isNaN(t)&&0<=t&&(this._getFillElement().style.width=t+"%",this._updateLabel(t))},t.setLabel=function(t){this.__label=t,this._updateLabel()},t._updateLabel=function(t){var e=this.__label;null==t&&(t=0),null!=e&&(e="function"==typeof e?e(this,t,this.__progress_val):e.replace(/%d/g,Math.round(t)).replace(/%f/g,t.toFixed(2)).replace(/%v/g,this.__progress_val),/\S/.test(e)||(e="&nbsp;"),this._getLabelElement().innerHTML=e)},t.reset=function(t,e,n,i){null==n&&(n=t),this.__progress_minVal=t,this.__progress_maxVal=e,3<arguments.length&&(this.__label=i),this.setValue(n)}}),DEFINE_CLASS("DlRadioButton",DlCheckbox,function(t,e){t.FIXARGS=function(t){t.alwaysCheck=!0},t.DEFAULT_ARGS={_groupId:["group",0],_classes:["classes",{active:"DlRadioButton-active",hover:"DlRadioButton-hover",checked:"DlRadioButton-1",unchecked:"DlRadioButton-0",empty:"DlRadioButton-empty",disabled:"DlRadioButton-disabled"}]},e.FINISH_OBJECT_DEF=function(){t.BASE.FINISH_OBJECT_DEF.call(this),this._className.remove("DlCheckbox")}}),DEFINE_CLASS("DlRadioSelect",DlButtonMenu,function(t,e){t.DEFAULT_ARGS={_options:["options",[]],_value:["value",null],_connected:["connected",!0]},t.DEFAULT_EVENTS=["onChange"],t.CONSTRUCT=function(){this._radioGroup=DlRadioGroup.get(),this._options.length&&this.setOptions(this._options),this.value(this._value,!0),this.addEventListener("onDestroy",function(){this._radioGroup.reset()})},e.value=function(t,e,n){var i=this._value;return(e||void 0!==t&&t!==i)&&(this._value=t,this._updateLabel(),n||this.applyHooks("onChange",[i,t])),i},e.getValue=function(){return this.value()},e.setValue=e.value,e._updateLabel=function(){for(var t,e=this._options,n=e.length;0<=--n;)null!=(t=e[n])&&(this._value==t.value?(this.getButton().label(t.label),t.widget.checked(!0,!0)):t.widget.checked(!1,!0))},e.setOptions=function(t){var e,n,i=this._radioGroup,i=(i.reset(),i.addEventListener("onChange",function(t){this.value(t.userData),DlPopup.clearAllPopups(),t._onMouseLeave()}.$(this)),e=new DlVMenu({className:"DlSelect-menu"}),n={parent:e,group:i,noCapture:!0},t.foreach(function(t){null==t?e.addSeparator():(n.label=t.label,n.data=n.value=t.value,n.className=t.className,t.widget=new DlRadioButton(n))},this),e.getElement()),s=(i.style.position="absolute",e.zIndex(-100),document.body.appendChild(i),e.getOuterSize().x);document.body.removeChild(i),e.zIndex(""),i.style.position="",function(){this.getButton().setOuterSize({x:s-this.getArrow().getOuterSize().x})}.$(this).delayed(10),this.setMenu(e),this._options=t},e.addOption=function(t,e){null==e&&(e=this._options.length);var n=t.widget=new DlRadioButton({parent:this._menu,group:this._radioGroup,noCapture:!0,label:t.label,data:t.value,value:t.value,className:t.className});return this._options.splice(e,0,t),n}}),DlRegexp={EMAIL:/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,MIME_WEB_IMAGE:/^image\x2f.*(png|jpe?g|gif|tiff?)/i,UNICODE_LETTER:"\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0523\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971\\u0972\\u097B-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D3D\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC\\u0EDD\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8B\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1159\\u115F-\\u11A2\\u11A8-\\u11F9\\u1200-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u1676\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19A9\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u2094\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2C6F\\u2C71-\\u2C7D\\u2C80-\\u2CE4\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31B7\\u31F0-\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000-\\uA48C\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA65F\\uA662-\\uA66E\\uA67F-\\uA697\\uA717-\\uA71F\\uA722-\\uA788\\uA78B\\uA78C\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA90A-\\uA925\\uA930-\\uA946\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAC00\\uD7A3\\uF900-\\uFA2D\\uFA30-\\uFA6A\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC"},DEFINE_SINGLETON("DlSystem",DlEventProxy,function(t,e){t.DEFAULT_EVENTS=["on-dialog-create","on-dialog-show","on-dialog-hide","on-dialog-minimize","on-dialog-restore","on-rpc-start","on-rpc-stop","on-rpc-timeout"]}),DEFINE_CLASS("DlRPC",DlEventProxy,function(t,e){t.CONSTRUCT=function(){null==this.method&&(this.method=null!=this.data?"POST":"GET"),this._timeoutID=0},t.DEFAULT_EVENTS="onStart onStop onTimeout onUploadProgress onUploadDone onUploadError onUploadAbort".qw(),t.DEFAULT_ARGS={url:["url",null],args:["args",null],callback:["callback",null],method:["method",null],data:["data",null],timeout:["timeout",null]},e.abort=function(){this._request.abort()},e.call=function(t){null!=t&&Object.merge(this,t);var e,n,i=!1;if(window.XMLHttpRequest)e=new XMLHttpRequest;else{if(!window.ActiveXObject)throw"Browser does not support XMLHttpRequest";e=new ActiveXObject("Microsoft.XMLHTTP")}(this._request=e).onreadystatechange=function(t){if(4==t.readyState){var e;delete t.onreadystatechange,this._request=null,this._timeoutID&&(clearTimeout(this._timeoutID),this._timeoutID=null);try{e={success:200==t.status,status:t.status,statusText:t.statusText,timeout:!1,xml:t.responseXML,text:t.responseText}}catch(t){}DlSystem().applyHooks("on-rpc-stop",[this,e,t]),this.applyHooks("onStop",[this,e,t]),this.callback&&this.callback(e)}}.$(this,e),e.upload&&(e.upload.addEventListener("progress",this.$("callHooks","onUploadProgress"),!1),e.upload.addEventListener("load",this.$("callHooks","onUploadDone"),!1),e.upload.addEventListener("error",this.$("callHooks","onUploadError"),!1),e.upload.addEventListener("abort",this.$("callHooks","onUploadAbort"),!1));var s=this.args;if(s){for(n in i=[],s)i.push(escape(n)+"="+escape(s[n]));i=0!=i.length&&i.join("&")}var o=this.url;switch(this.method){case"POST":var l=this.data;i&&l&&(o+="?"+i),e.open("POST",o,!0),l?("string"!=typeof l&&(l=DlJSON.encode(l),this.data=l,e.setRequestHeader("Content-Type","text/javascript; charset=UTF-8")),this._start(l)):(e.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),this._start(i));break;case"GET":i&&(o+="?"+i),e.open("GET",o,!0),this._start(null)}},e._start=function(t){this.timeout?this._timeoutID=function(t){this._request=null,t.abort(),DlSystem().applyHooks("on-rpc-timeout",[this,t]),this.applyHooks("onTimeout",[this,t]),this.callback&&this.callback({success:!1,timeout:!0})}.delayed(this.timeout,this,this._request):this._timeoutID=0,DlSystem().applyHooks("on-rpc-start",[this]),this.applyHooks("onStart",[this]),this._request.send(t)}}),DEFINE_CLASS("DlRteFrame",DlWidget,function(n,t,s){var e=s.createElement,i=s.addClass,o=s.delClass,l=s.condClass,r=s.ID,a=["mouseover","mouseout","mousemove","mousedown","mouseup","click","keydown","keyup","keypress","contextmenu"],u=is_gecko?"<br type='_moz' />":"",h='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html class="DlRteFrame-HTML"><head><title>DynarchLIB Rich Text Editor</title></head><body class="DlRteFrame-Body"><p>'+u+"</p></body></html>",c=(n.BEFORE_BASE=function(){this.__eventProxy=function(e){e=e||this.getIframeWin().event;var t=new DlEvent(e);"oncontextmenu"==t.type&&s.stopEvent(e);t.origTarget=t.target;var n=t.origPos=t.pos,i=s.getPos(this.getIframeElement());t.pos={x:n.x+i.x,y:n.y+i.y},t.target=this.getElement();try{DlEvent._genericEventHandler(t,e)}catch(t){t instanceof DlExStopFrameEvent&&s.stopEvent(e)}/onMouseDown|onMouseUp|onKey/.test(t.dl_type)&&this.callUpdateHooks(t,e)}.$(this),this.callUpdateHooks=this.callUpdateHooks.clearingTimeout(40,this)},n.CONSTRUCT=function(){this.__sections&&this.setSections(this.__sections)},n.DEFAULT_EVENTS=["onUpdate","onSectionChange"],n.DEFAULT_ARGS={__paragraphsMode:["useParagraphs",!0],__sections:["sections",null],_focusable:["focusable",2],_tabChar:["tabChar","    "]},t.COMMANDS={backcolor:{id:is_ie?"backcolor":"hilitecolor"},forecolor:{id:"forecolor"},bold:{id:"bold",key:"CTRL 'B'"},italic:{id:"italic",key:"CTRL 'I'"},underline:{id:"underline",key:"CTRL 'U'"},strike:{id:"strikethrough",key:"CTRL '-'"},subscript:{id:"subscript"},superscript:{id:"superscript"},removeformat:{id:"removeformat",key:"ALT-CTRL '0'"},justifyleft:{id:"justifyleft",key:"ALT-CTRL 'l'"},justifyright:{id:"justifyright",key:"ALT-CTRL 'r'"},justifycenter:{id:"justifycenter",key:"ALT-CTRL 'e'"},justifyfull:{id:"justifyfull",key:"ALT-CTRL 'j'"},orderedlist:{id:"insertorderedlist",key:"ALT-CTRL 'o'"},unorderedlist:{id:"insertunorderedlist",key:"ALT-CTRL-SHIFT 'o'"},unorderedlist1:{id:"insertunorderedlist",key:"ALT-CTRL 'u'"},indent:{id:"indent",key:"CTRL '.'"},outdent:{id:"outdent",key:"CTRL ','"},undo:{id:"undo"},redo:{id:"redo"},"<hr>":{id:"inserthorizontalrule",key:"CTRL ' '"},"<h1>":{id:"formatblock",key:"CTRL '1'",arg:"h1"},"<h2>":{id:"formatblock",key:"CTRL '2'",arg:"h2"},"<h3>":{id:"formatblock",key:"CTRL '3'",arg:"h3"},"<h4>":{id:"formatblock",key:"CTRL '4'",arg:"h4"},"<h5>":{id:"formatblock",key:"CTRL '5'",arg:"h5"},"<h6>":{id:"formatblock",key:"CTRL '6'",arg:"h6"},"<p>":{id:"formatblock",key:"CTRL 'm'",arg:"p"},"<pre>":{id:"formatblock",key:"CTRL-ALT 'n'",arg:"pre"},"<address>":{id:"formatblock",arg:"pre"},"<blockquote>":{id:"formatblock",key:"CTRL 'q'",arg:"blockquote"},_nextSection:{id:"_nextSection",key:"CTRL ']'"},_prevSection:{id:"_prevSection",key:"CTRL '['"},showHtml:{id:"showHtml",key:"CTRL-ALT-SHIFT 'h'"}},"h1 h2 h3 h4 h5 h6 p pre address blockquote".hashWords());function d(){var t=this.getIframeDoc();s.removeEvents(t,a,this.__eventProxy),is_ie?(delete(t=this.getIframeElement()).onfocus,t.onfocus=null):s.removeEvent(t,"focus",this.__rte_onFocus),delete t.onblur,t.onblur=null}t.SEMANTIC_TAGS={bold:!0,italic:!0,strike:!0,strike:!0,subscript:!0,superscript:!0,indent:!0,underline:!0,outdent:!0,strikethrough:!0},t.callUpdateHooks=function(t,e){this.destroyed||this.applyHooks("onUpdate",[t,e])},t.execCommand=function(t,e){if(!this.readonly()){this.focus();var n,i=this.getIframeDoc();if(is_gecko&&i.execCommand("styleWithCSS",!1,!(t in this.SEMANTIC_TAGS)),this.COMMANDS[t]&&(t=this.COMMANDS[t],void 0===e&&(e=t.arg||""),t=t.id),"formatblock"==t&&is_ie){var s=this.getAncestorsHash();if(s.pre){if("pre"==e)return;var o=this.getSelection(),o=this.getRange(o),l=this.createRange();l.moveToElementText(s.pre),o.setEndPoint("EndToEnd",l),o.select();var r,a,u=String.buffer("<",e,">dummy</",e,">").get();return 0==o.compareEndPoints("StartToStart",l)?(s.pre.insertAdjacentHTML("beforeBegin",u),r=s.pre.previousSibling):(l=o.htmlText,a=o.text,o.moveStart("character",-1),o.text.charAt(0)!=a.charAt(0)&&o.moveStart("character",1),s.pre.insertAdjacentHTML("afterEnd","<br />"),o.pasteHTML(""),s.pre.parentNode.removeChild(s.pre.nextSibling),s.pre.insertAdjacentHTML("afterEnd",u),r=s.pre.nextSibling,/\S/.test(a)&&((u=s.pre.cloneNode(!0)).innerHTML=l,r.parentNode.insertBefore(u,r.nextSibling))),o.moveToElementText(r),o.collapse(),o.select(),void(r.innerHTML="")}e="<"+e+">"}switch(t){case"showHtml":try{alert(this.getHTML())}catch(t){alert("ERROR: "+t)}break;case"_nextSection":this.nextSection();break;case"_prevSection":this.prevSection();break;default:n=i.execCommand(t,!1,e)}return this.focus(),this.callUpdateHooks(),n}},t.queryCommandState=function(t){if(!this.readonly()){this.COMMANDS[t]&&(t=this.COMMANDS[t].id);try{return this.getIframeDoc().queryCommandState(t)}catch(t){}}},t.queryCommandValue=function(t){if(!this.readonly()){if(this.COMMANDS[t]&&(t=this.COMMANDS[t].id),!is_gecko&&/^formatblock$/i.test(t))for(var e=this.getAllAncestors(),n=0;n<e.length;++n){var i=e[n].tagName.toLowerCase();if(i in c)return i}try{return this.getIframeDoc().queryCommandValue(t)}catch(t){}}},t.getInnerHTML=function(){return this.getIframeBody().innerHTML},t.getHTML=function(t,e){is_ie||e||(this.collapse(!0),(n=this.getIframeDoc().createElement("span")).id="DYNARCHLIB_RTEFRAME_CARET",this.insertNode(n));var n,t=DlHtmlUtils.getHTML(this.getIframeBody(),!1,t);return is_ie||e||this.deleteNode(n),t},t.getInnerText=function(){return DlHtmlUtils.getInnerText(this.getIframeBody())},t.getText=function(){return DlHtmlUtils.getText(this.getIframeBody())},t.setSections=function(t){this.__sections=t;var n=this.__sectionsHash={};t.foreach(function(t,e){t.index=e,!(n[t.name]=t).current&&0!=e||(this.__currentSection=e,this.setHTML(t.content))}.$(this))},t.setSectionContent=function(t,e){t=this.getSection(t,!0);t.content=e,t.index==this.__currentSection&&this.setHTML(e)},t.getSections=function(){var t=this.getHTML(!0);return Object.merge(this.getCurrentSection(),t),this.__sectionsHash},t.getSection=function(t,e){t=this.__sectionsHash[t];return t.index!=this.__currentSection||e||(e=this.getHTML(!0),Object.merge(t,e)),t},t.getCurrentSection=function(){return this.__sections[this.__currentSection]},t._setCurrentSection=function(t){var e,n=this.getCurrentSection();n!==t&&(e=this.getHTML(!0),Object.merge(n,e),this.__currentSection=t.index,this.setHTML(t.content),this.applyHooks("onSectionChange",[n,t]))},t.setCurrentSection=function(t){t=this.__sectionsHash[t];this._setCurrentSection(t)},t.setCurrentSectionIndex=function(t){t!=this.__currentSection&&(t=this.__sections[t],this._setCurrentSection(t))},t.prevSection=function(){this.setCurrentSectionIndex(this.__sections.rotateIndex(this.__currentSection-1))},t.nextSection=function(){this.setCurrentSectionIndex(this.__sections.rotateIndex(this.__currentSection+1))},t._setListeners=function(){n.BASE._setListeners.call(this),this.addEventListener(is_ie?"onKeyDown":"onKeyPress",function(t){this._onKeypress(t)}),this.addEventListener({onDestroy:d})},t._createElement=function(){n.BASE._createElement.call(this);e("iframe",{display:"block"},{frameBorder:0,marginHeight:0,marginWidth:0,src:is_ie?"javascript:'';":"about:blank"},this.getElement());this.__hasFrameEvents=!1,this.updateKeymap()},t.updateKeymap=function(){var t,e=this.__rte_keymap=[];for(t in this.COMMANDS){var n=this.COMMANDS[t];n.key&&e.push([DlKeyboard.parseKey(n.key),t])}},t.setOuterSize=t.setSize=function(t){var e=s.getBorder(this.getElement()),n=s.getBorder(this.getContentElement());this.setInnerSize({x:t.x-e.x-n.x,y:t.y-e.y-n.y})},t.getIframeElement=function(){return this.getElement().firstChild},t.getContentElement=t.getIframeElement,t.getIframeWin=function(){return this.getIframeElement().contentWindow},t.getIframeDoc=function(){return this.getIframeWin().document},t.getIframeBody=function(){return this.getIframeDoc().body},t.initDesignMode=function(t){var e=this.getIframeDoc();e.open(),e.write(h),e.close(),e.designMode="on",this.__hasFrameEvents||function(t){var e=this.getIframeDoc();this.__hasFrameEvents=!0,s.addEvents(e,a,this.__eventProxy),this.__rte_onFocus=function(){i(this.getIframeDoc().documentElement,"DlRteFrame-Focused"),n.BASE.focus.call(this)}.$(this),this.__rte_onBlur=function(){o(this.getIframeDoc().documentElement,"DlRteFrame-Focused"),n.BASE.blur.call(this,!0)}.$(this),is_ie?(e=this.getIframeElement()).onfocus=this.__rte_onFocus:s.addEvent(e,"focus",this.__rte_onFocus);e.onblur=this.__rte_onBlur,t&&t.call(this);this.__pendingHTML&&(this.getIframeBody().innerHTML=this.__pendingHTML,this._onSetHTML(),this.moveBOF(),this.__pendingHTML=null)}.delayed(5,this,t)},t.readonly=function(t){var e=this.getIframeDoc();return 0<arguments.length&&(e.designMode=t?"off":"on",l(e.documentElement,t,"DlRteFrame-ReadOnly")),"off"==e.designMode},t.setHTML=function(t){if(t=(t=t instanceof Array?t.join(""):t).trim(),this.__hasFrameEvents){is_ie&&(t=t.replace(/(<pre[^>]*>)((.|\n)+?)(<\x2fpre>)/gi,function(t,e,n,i,s){return e+(n=n.replace(/\x20/g," ").replace(/\t/g," ".repeat(4)))+s})),this.getIframeBody().innerHTML=t,this._onSetHTML();try{this.moveBOF()}catch(t){}this.callUpdateHooks()}else this.__pendingHTML=t},t._onSetHTML=function(){for(var t,e=this.getIframeDoc().getElementsByTagName("pre"),n=e.length;0<=--n;){var i=e[n];i.innerHTML=i.innerHTML.replace(/\n/g,"<br>")}is_ie||(t=this.getIframeDoc().getElementById("DYNARCHLIB_RTEFRAME_CARET"))&&function(t){try{this.selectNodeContents(t),this.collapse(!0),this.deleteNode(t)}catch(t){}}.delayed(10,this,t)},t.clear=function(){this.setHTML("")},t.focus=function(){this.getIframeWin().focus(),n.BASE.focus.call(this)},t.loadStyle=function(t){var e,n=this.getIframeDoc(),i=t.replace(/\x2f/g,"_");n.getElementById(i)||(e=n.getElementsByTagName("head")[0],(n=n.createElement("link")).type="text/css",n.rel="stylesheet",n.href=t,n.id=i,e.appendChild(n),n.disabled=!0,n.disabled=!1)},t.createRange=function(){return is_ie?this.getIframeBody().createTextRange():this.getIframeDoc().createRange()},t.getSelection=function(){return is_ie?this.getIframeDoc().selection:this.getIframeWin().getSelection()},t.getRange=function(t){return null==t&&(t=this.getSelection()),is_ie?t.createRange():t.getRangeAt(0)},t.getParentElement=function(){var t=this.getSelection(),e=this.getRange(t);if(is_ie)switch(t.type){case"Text":case"None":return e.parentElement();case"Control":return e.item(0);default:return null}else try{var n=e.commonAncestorContainer;for(!e.collapsed&&e.startContainer==e.endContainer&&e.startOffset-e.endOffset<=1&&e.startContainer.hasChildNodes()&&(n=e.startContainer.childNodes[e.startOffset]);3==n.nodeType;)n=n.parentNode;return n}catch(t){return null}},t.getAllAncestors=function(){for(var t=this.getParentElement(),e=(t&&1==t.nodeType&&(t=this.getParentElement()),this.getIframeBody()),n=[];t&&t!==e&&1==t.nodeType;)n.push(t),t=t.parentNode;return n.push(e),n},t.getAncestorsHash=function(){var e,t=this.getAllAncestors(),n={__all:t};return t.foreach(function(t){e=t.tagName.toLowerCase(),n[e]||(n[e]=t)}),n},t.getSelectedText=function(){var t=this.getRange();return is_ie?t.text:t.toString()},t.selectRange=function(t){var e;is_ie?t.select():((e=this.getSelection()).removeAllRanges(),e.addRange(t))},t.isCollapsed=function(){var t=this.getRange();return is_w3?t.collapsed:0==t.compareEndPoints("StartToEnd",t)},t.collapse=function(t){var e=this.getSelection(),n=this.getRange(e);is_w3&&e.removeAllRanges(),n.collapse(!!t),this.selectRange(n)},t.insertNode=function(t,e){var n=this.getSelection(),i=this.getRange(n);return is_w3?(i.deleteContents(),i.insertNode(t),e&&(n.removeAllRanges(),i.selectNode(t),n.addRange(i))):(n=r("rteframe"),i.pasteHTML(["<span id='",n,"'></span>"].join("")),(n=this.getIframeDoc().getElementById(n)).parentNode.insertBefore(t,n),n.parentNode.removeChild(n),e&&3!=t.nodeType&&(i.moveToElementText(t),i.select())),t},t.insertText=function(t,e){t=this.getIframeDoc().createTextNode(t);return this.insertNode(t,e)},t.selectNodeContents=function(t){var e=this.createRange();is_w3?e.selectNodeContents(t):e.moveToElementText(t),this.selectRange(e)},t.selectNode=function(t){var e;is_w3?((e=this.createRange()).selectNode(t),this.selectRange(e)):this.selectNodeContents(t)},t.createLink=function(t,e){var n,i,s,o;for(e&&this.insertText(e,!0),n="javascript:"+r("link"),this.execCommand("createlink",n),o=(i=this.getIframeDoc().getElementsByTagName("a")).length;0<=--o;)if(i[o].href==n){s=i[o];break}return s.href=t,s},t.createAnchor=function(t){var e=this.getSelectedText()?null:"Anchor",n=this.createLink("#",e);return n.removeAttribute("href"),i(n,e?"DlAnchor-Empty":"DlAnchor"),n.setAttribute("name",t),e&&(n.innerHTML=""),n},t.getAnchors=function(){for(var t,e=this.getIframeDoc().getElementsByTagName("a"),n=e.length,i=[];0<=--n;)(t=e[n]).name&&i.unshift(t);return i},t.unlink=function(){this.execCommand("unlink")},t.getSelectedImage=function(){var t=this.getParentElement();return t=t&&!/^img$/i.test(t.tagName)?null:t},t.insertImage=function(t){var e=this.getSelectedImage();if(!e){var n,i,s="javascript:"+r("img");for(this.execCommand("insertimage",s),i=(n=this.getIframeDoc().getElementsByTagName("img")).length;0<=--i;)if(n[i].src==s){e=n[i];break}}return e.src=t.url,t.width&&(e.width=t.width),t.height&&(e.height=t.height),t.align&&(e.align=t.align),t.alt&&(e.alt=t.alt),t.marginLeft&&(e.style.marginLeft=t.marginLeft),t.marginTop&&(e.style.marginTop=t.marginTop),t.marginRight&&(e.style.marginRight=t.marginRight),t.marginBottom&&(e.style.marginBottom=t.marginBottom),e},t.moveBOF=function(t){var e,n,i=this.getIframeBody(),s=t?i.lastChild:i.firstChild;s&&(is_w3?(n=this.getRange(e=this.getSelection()),e.removeAllRanges(),1==s.nodeType?n.selectNodeContents(s):n.selectNode(s),n.collapse(!t),e.addRange(n)):((n=i.createTextRange()).collapse(!t),n.select()))},t.moveEOF=function(t){return this.moveBOF(!t)},t.setParagraphsMode=function(t){this.__paragraphsMode=t},t.addBlockClass=function(t,e,n){t=this.getAncestorsHash()[t];if(t){if(s.hasClass(t,e)){if(n)return s.delClass(t,e),!1}else s.addClass(t,e);return!0}return null},t.canDeleteFullNode=function(t){return DlHtmlUtils.canDeleteFullNode(t.tagName)},t.canDeleteContent=function(t){return DlHtmlUtils.canDeleteContent(t.tagName)},t.canStripNode=function(t){return DlHtmlUtils.canStripNode(t.tagName)},t.deleteNodeContents=function(t){t.innerHTML=DlHtmlUtils.isBlockElement(t)?u:""},t.deleteNode=function(t){t.parentNode.removeChild(t)},t.stripNode=function(t){for(var e=t.ownerDocument.createDocumentFragment();t.firstChild;)e.appendChild(t.firstChild);t.parentNode.insertBefore(e,t),t.parentNode.removeChild(t),this.callUpdateHooks()},t._onKeypress=function(e){var t=e.keyCode;if(this.__rte_keymap.r_foreach(function(t){if(DlKeyboard.checkKey(e,t[0]))throw this.execCommand(t[1]),new DlExStopFrameEvent},this),t==DlKeyboard.TAB){if("pre"==this.queryCommandValue("formatblock"))throw this.insertText(this._tabChar,!0),this.collapse(!1),new DlExStopFrameEvent}else if(t==DlKeyboard.ENTER&&is_ie&&!e.shiftKey)if("pre"==this.queryCommandValue("formatblock"))throw t=this.getSelection(),this.getRange(t).pasteHTML("<br/><div class='DynarchLIB-REMOVE-ME'></div>"),new DlExStopFrameEvent}}),DEFINE_CLASS("DlSocket",DlEventProxy,function(t,e){function n(){return DlFlashUtils().getObject()}t.DEFAULT_EVENTS=["onConnect","onRelease","onData"],t.DEFAULT_ARGS={_host:["host",null],_port:["port",null],_json:["json",!1]},t.FIXARGS=function(t){t.host||(t.host=document.domain)},t.CONSTRUCT=function(t){this.addEventListener("onDestroy",s),DlEvent.atUnload(this.destroy.$(this))};var i={};function s(){n().DlSocket_destroy(this.id),delete i[this.id]}e.send=function(t){n().DlSocket_send(this.id,t)},e.sendJSON=function(t){n().DlSocket_send(this.id,DlJSON.encode(t))},e.connect=function(){this.id=n().DlSocket_connect(this._host,this._port),i[this.id]=this},e.reconnect=function(){n().DlSocket_reconnect(this.id)},e.disconnect=function(){n().DlSocket_disconnect(this.id)},window.DlSocket_onConnect=function(t,e){i[t].applyHooks("onConnect",[e])},window.DlSocket_onData=function(t,e){e=DlFlashUtils.decodeString(e);t=i[t];t._json&&(e=DlJSON.decode(e)),t.applyHooks("onData",[e])},window.DlSocket_onDisconnect=function(t,e){i[t].applyHooks("onRelease",[e])}}),DEFINE_CLASS("DlSound",DlEventProxy,function(t,e){var n={};function i(){return DlFlashUtils().getObject()}function s(){delete n[this.id]}function o(t){(this.__fileLoaded=t)&&this.__shouldPlay&&(this.play.apply(this,this.__shouldPlay),this.__shouldPlay=null)}t.DEFAULT_EVENTS=["onLoad","onComplete"],t.DEFAULT_ARGS={_volume:["volume",null],_pan:["pan",null],_url:["url",null],_stream:["stream",!1]},t.CONSTRUCT=function(t){this.addEventListener({onDestroy:s,onLoad:o}),this.id=i().DlSound_create(),null!=this._volume&&this.setVolume(this._volume),null!=this._pan&&this.setPan(this._pan),n[this.id]=this},e.load=function(t,e){null==t&&(t=this._url),null==e&&(e=this._stream),this.__fileLoaded=!1,this.__loadCalled=!0,i().DlSound_load(this.id,this._url=t,this._stream=e)},e.play=function(t,e){this.__fileLoaded?i().DlSound_play(this.id,t,e):this.__loadCalled||(this.__shouldPlay=[t,e],this.load())},e.stop=function(){i().DlSound_stop(this.id)},e.getBytesLoaded=function(){return i().DlSound_getBytesLoaded(this.id)},e.getBytesTotal=function(){return i().DlSound_getBytesTotal(this.id)},e.getDuration=function(){return i().DlSound_getDuration(this.id)},e.getPosition=function(){return i().DlSound_getPosition(this.id)},e.setPan=function(t){i().DlSound_setPan(this.id,this._pan=t)},e.setVolume=function(t){i().DlSound_setVolume(this.id,this._volume=t)},e.getPan=function(){return this._pan},e.getVolume=function(){return this._volume},e.getURL=function(){return this._url},window.DlSound_onLoad=function(t,e){n[t].applyHooks("onLoad",[e])},window.DlSound_onSoundComplete=function(t){n[t].callHooks("onComplete")}}),DEFINE_CLASS("DlSpinner",DlEntry,function(n,t,e){var i=e.createElement;function s(){this.select()}function o(){this._clearTimer()}function l(t){throw this._spinnerUpdateVal(0<t.wheelDelta),new DlExStopEventBubbling}function r(t){switch(t.keyCode){case DlKeyboard.ARROW_DOWN:throw h.call(this,{_direction:!1}),new DlExStopEventBubbling;case DlKeyboard.ARROW_UP:throw h.call(this,{_direction:!0}),new DlExStopEventBubbling}}function a(t){this._clearTimer()}function u(){var t=this.getValue(),e=t==this._maxVal,t=t==this._minVal;this._buttonUp.disabled(e||!!this.readonly()),this._buttonDown.disabled(t||!!this.readonly()),(e||t)&&this._clearTimer()}function h(t){throw this._spinnerUpdateVal(t._direction),(this._timerState=Array.$(this.intervals)).r_foreach(function(t){t.step*=this.step},this),this._timerPos=0,this._startTimer(t._direction,250),new DlExStopEventBubbling}n.FIXARGS=function(t){t.validators=[new DlValidator(DlValidator.Number,t.minVal,t.maxVal,t.integer,t.decimals)],t.type="text"},n.CONSTRUCT=function(){this._timer=null,this._timerStep=null,this._timerState=null,this._timerPos=null},n.DEFAULT_EVENTS=["onSpin"],n.DEFAULT_ARGS={_step:["step",1],_size:["size",4],_value:["value",0],_minVal:["minVal",null],_maxVal:["maxVal",null],_decimals:["decimals",null],_integer:["integer",!1]},t.intervals=[{pos:1,step:1,speed:125},{pos:10,step:1,speed:70},{pos:20,step:1,speed:35},{pos:50,step:1,speed:20},{pos:100,step:1,speed:10},{pos:200,step:2,speed:10}],t._createElement=function(){this._no_gecko_bug=!0,n.BASE._createElement.call(this);var t=this.getElement().rows[0].cells[0],e=(t.rowSpan=2,t=t.parentNode,i("tr",null,null,t.parentNode)),t=i("td",null,{className:"DlSpinner-Button DlSpinner-Button-Up"},t),e=i("td",null,{className:"DlSpinner-Button DlSpinner-Button-Down"},e);this._buttonUp=new DlButton({parent:this,appendArgs:t}),this._buttonDown=new DlButton({parent:this,appendArgs:e}),this._btn=this._buttonUp},t._setListeners=function(){n.BASE._setListeners.call(this),this.addEventListener({onFocus:s,onBlur:o,onMouseWheel:l,onKeyDown:r,onKeyUp:a,onChange:u})},t.initDOM=function(){n.BASE.initDOM.call(this),this._setupSpinnerBtn(this._buttonUp,!0),this._setupSpinnerBtn(this._buttonDown,!1)},t.readonly=function(t){return null!=t&&(this._buttonUp.disabled(t),this._buttonDown.disabled(t)),n.BASE.readonly.apply(this,arguments)},t.getFormValue=function(){var t=this.getValue(),e=parseFloat(t);return isNaN(e)?t:e},t._spinnerUpdateVal=function(t){var e,n;this._readonly||(n=new Number(this.getValue()),e=this._timerStep||this._step,n=t?n+e:n-e,null!=this._minVal&&n<this._minVal&&(n=this._minVal),null!=this._maxVal&&n>this._maxVal&&(n=this._maxVal),this.setValue(n),this.applyHooks("onSpin",[n]),this.focus(),this.select(),this._timer&&(e=++this._timerPos,this._timerState.length)&&e==this._timerState[0].pos&&(n=this._timerState.shift(),this._clearTimer(!0),this._timerStep=n.step,this._startTimer(t,n.speed)))},t._clearTimer=function(t){this._timer&&clearInterval(this._timer),t||(this._timerState=null,this._timerStep=null,this._timerPos=null),this._timer=null},t._startTimer=function(t,e){this._timer&&clearInterval(this._timer),this._timer=setInterval(this._spinnerUpdateVal.$(this,t),e)},t._setupSpinnerBtn=function(t,e){t._direction=e;e=function(t){this._clearTimer()}.$(this,t);t.addEventListener({onMouseDown:h.$(this,t),onMouseUp:e})},t.setMinVal=function(t,e){this._minVal=t;var n=this.getFormValue();null!=n&&!isNaN(n)&&n<t&&this.setValue(t,e)},t.setMaxVal=function(t,e){this._maxVal=t;var n=this.getFormValue();null!=n&&!isNaN(n)&&t<n&&this.setValue(t,e)}}),DEFINE_CLASS("DlStyleSheet",DlEventProxy,function(t,e,a){function n(){a.trash(this._el),this._s=null,this._el=null}t.CONSTRUCT=function(){this._init()},e.insertRule=function(t,e,n){var i=this._s;if(null==n&&(n=this.getRules().length),"object"==typeof e){var s=[];for(r in e)s.push(r+":"+e[r]);e=s.join(";")}else e instanceof Array&&(e=e.join(";"));if(is_ie){if(1!=(t=t.split(/\s*,\s*/)).length){for(var o=a.ID(),l=this._ier[o]=[],r=0;r<t.length;++r)i.addRule(t[r],e,n+r),l.push(this.getRules()[n+r]);return o}i.addRule(t,e,n)}else i.insertRule(t+"{"+e+"}",n);return this.getRules()[n]},e.deleteRule=function(t){if(is_ie&&"string"==typeof t)this._ier[t].foreach(this.deleteRule.$(this)),delete this._ier[t];else for(var e=this.getRules(),n=e.length;0<=--n;)if(e[n]===t)return is_ie?this._s.removeRule(n):this._s.deleteRule(n),n},e.modifyRule=function(t,e){if(is_ie&&"string"==typeof t)this._ier[t].foreach(function(t){this.modifyRule(t,e)},this);else for(var n in e)t.style[n]=e[n]},e.refresh=function(){var t=this.disabled();this.disabled(!t),this.disabled(t)},e.getRules=function(){return is_ie?this._s.rules:this._s.cssRules},e.disabled=function(t){var e=is_ie?this._s:this._el;return null!=t&&(e.disabled=t),!!e.disabled},e._init=function(){is_ie&&(this._ier={}),this._el=a.createElement("style",null,{type:"text/css"},document.getElementsByTagName("head")[0]),this._s=document.styleSheets[document.styleSheets.length-1],this.addEventListener("onDestroy",n)}}),DEFINE_CLASS("DlTabs",DlContainer,function(n,t,e){function i(t){throw this.checked(!0),new DlExStopEventProcessing}n.DEFAULT_EVENTS=["onChange"],n.DEFAULT_ARGS={_tabPos:["tabPos","top"]},t.addTab=function(t,e,n){return this._tabContent.appendWidget(t,n),t._tab=new DlButton({label:e,parent:this._tabBar,group:this._tabGroup,type:DlButton.TYPE.TWOSTATE,data:this._tabContent.length()-1}),t._tab.addEventListener("onClick",i,!0),t.addEventListener("onDestroy",t._tab.destroy.$(t._tab)),t},t.addTab2=function(t){var e=this.addTab(t.widget,t.title,t.pos);return t.iconClass&&e._tab.setIconClass(t.iconClass),e},t.getTabBar=function(){return this._tabBar},t.getNotebook=function(){return this._tabContent},t.getTabButton=function(t){return this.getNotebook().getPane(t)._tab},t.getTabContent=t.getNotebook,t.initDOM=function(){switch(n.BASE.initDOM.call(this),this._tabGroup=DlRadioGroup.get(this.id),this._tabBar=new DlHbox({className:"TabBar"}),this._tabContent=new DlNotebook({className:"TabContent"}),this._tabPos){case"top":case"left":this.appendWidget(this._tabBar),this.appendWidget(this._tabContent);break;case"bottom":case"right":this.appendWidget(this._tabContent),this.appendWidget(this._tabBar)}this._tabContent.addEventListener("onChange",function(t,e,n){var i=null!=e?this._panes[e]:null;i&&i._tab.checked(!0),t.applyHooks("onChange",[e,n])}.$(this._tabContent,this)),this._tabGroup.addEventListener("onChange",function(t){t.checked()&&this._tabContent.showPane(t.userData)}.$(this)),this.addClass("DlTabs-"+this._tabPos)},t.setTabPos=function(t){var e=this._tabBar.getElement(),n=this._tabContent.getElement(),i=(e.parentNode&&e.parentNode.removeChild(e),"top"==t||"left"==t?n:null);n.parentNode.insertBefore(e,i),this.addClass("DlTabs-"+t,"DlTabs-"+this._tabPos),this._tabPos=t},t.setTabAlign=function(t){return this._tabBar.setAlign(t)},t.setOuterSize=t.setSize=function(t){n.BASE.setSize.call(this,t),t=this.getInnerSize();var e=this._tabBar.getSize();switch(this._tabPos){case"top":case"bottom":t.y-=e.y;break;case"left":case"right":t.x-=e.x}this._tabContent.setSize(t)},t.showPane=function(t){return this._tabContent.showPane(t)},t.nextPane=function(){return this._tabContent.nextPane()},t.prevPane=function(){return this._tabContent.prevPane()},t.isFirstPane=function(){return this._tabContent.isFirstPane()},t.isLastPane=function(){return this._tabContent.isLastPane()},t.getCurrentPane=function(){return this._tabContent.getCurrentPane()},t.getCurrentPaneIndex=function(){return this._tabContent.getCurrentPaneIndex()},t._handle_focusKeys=function(t){t.shiftKey?t.keyCode==DlKeyboard.PAGE_UP?(this.prevPane(),this.getCurrentPane()._tab.focus(),DlException.stopEventBubbling()):t.keyCode==DlKeyboard.PAGE_DOWN&&(this.nextPane(),this.getCurrentPane()._tab.focus(),DlException.stopEventBubbling()):t.keyCode==DlKeyboard.TAB&&this._tabBar.focusInside()&&(t=this.getCurrentPane().getFirstFocusWidget())&&(t.focus(),DlException.stopEventBubbling())}}),DlTextUtils=function(){var d,r=DynarchDomUtils,a=DlKeyboard,s=[/^(\s*[-*]+\s+)/,function(t){return[t," ".x(t[0].length),t[0].length]},/^(\s*)([0-9]+)(\.\s+)/,function(e){return[function(){var t=parseInt(e[2],10)+1;return e[1]+t+e[3]}," ".x(e[0].length),e[0].length]},/^(\s*)([a-z])(\)\s+)/i,function(e){return[function(){var t=String.fromCharCode(e[2].charCodeAt(0)+1);return e[1]+t+e[3]}," ".x(e[0].length),e[0].length]},/^\s*([>|]\s*)*/,function(t){return[t,t[0],t[0].length,/\n\s*([>|]\s*)*/g,"\n"]},/^\s+/,function(t){return[t,t[0],t[0].length]}],u=[a.ARROW_UP,a.ARROW_DOWN].toHash(!0),_=String.fromCharCode(0);function e(t){t=t||window.event;var e,n,i,s=r.getSelectionRange(this),o={x:this.scrollLeft,y:this.scrollTop};function l(){return this.scrollLeft=o.x,this.scrollTop=o.y,r.stopEvent(t)}return t.altKey&&113==t.charCode?(i=d.fillText(this.value,72,s.start),this.value=i.text,r.setSelectionRange(this,i.pos,i.pos),l.call(this)):t.ctrlKey&&t.keyCode in u?(i=t.keyCode==a.ARROW_UP,e=d.getParagraph(this.value,i?s.start:s.end),n=(i?e.start-1:e.end+1).limit(0,this.length),r.setSelectionRange(this,t.shiftKey?i?s.end:s.start:n,n),r.stopEvent(t)):t.altKey&&t.keyCode==a.ENTER?(i=this.value,e=d.getParagraph(i,s.start),s="function"==typeof(s=(n=d.getFillPrefix(e.text))[0])?s(n):s[0],i=i.substr(0,e.end)+"\n\n"+s+i.substr(e.end),this.value=i,r.setSelectionRange(this,e.end+2+s.length),l.call(this)):void 0}var o=/\n([>|\s]*\n)+/g;return d={getParagraph:function(t,e){var n,i=function(t,e,n){for(var i=-1,s=(e.lastIndex=0,e.global=!0,-1);e.exec(t)&&!(e.lastIndex>=n);){if((i=e.lastIndex)==s)throw"Repeated! "+i;s=i}return i}(t,o,e+1),s=(n=t,(s=o).lastIndex=e=e,s.global=!0,(e=s.exec(n))?e.index:null);return{start:i=-1==i?0:i,end:s=null==s?t.length:s,text:t.substring(i,s)}},getFillPrefix:function(t){var e,n,i=0;for(t=t.replace(/\x00/g,"");i<s.length;)if(n=s[i++],e=s[i++],n.lastIndex=0,n=n.exec(t))return e(n)},fillParagraph:function(t,e,n){t=t.substr(0,n)+_+t.substr(n);for(var i,s,o=d.getFillPrefix(t),l=o[1],r=o[2],a=t.substr(0,r),u=(t=t.substr(r),t=(t=o[3]?t.replace(o[3],function(t){return o[4]||""}):t).replace(/\n/g," ").replace(/([^.?!])\s\s+/g,"$1 "),new RegExp("(.{0,"+(e-l.length)+"})(\\s+|$)","g")),h=[],c=0;(i=u.exec(t))&&(s=u.index!=c?t.substring(c,u.lastIndex):i[1],c=u.lastIndex,/\S/.test(s));)h.push(s.trim(!0));return{text:t=0<=(n=(t=a+h.join("\n"+l)).indexOf(_))?t.substr(0,n)+t.substr(n+1):t,pos:n}},fillText:function(t,e,n){var i=d.getParagraph(t,n),s=t.substr(0,i.start),t=t.substr(i.end),n=n-i.start,e=d.fillParagraph(i.text,e,n);return{text:s+e.text+t,pos:i.start+e.pos}},emacsipateTextarea:function(t){r.addEvent(t,is_ie?"keydown":"keypress",e)}}}(),DEFINE_CLASS("DlTooltip",DlPopup,function(t,e){t.FIXARGS=function(t){t.zIndex=2e3,t.focusable=!1,this._mouseDiff={x:8,y:12}}}),DEFINE_CLASS("DlTree",DlContainer,function(n,t,e){n.CONSTRUCT=function(){this.__treeItems=[]},t.getItem=function(t){return this.__treeItems[t]},t.getItems=function(){return this.__treeItems},t.appendWidget=function(t,e){t instanceof DlTreeItem&&t.parent===this&&e>t.getIndex()&&--e,n.BASE.appendWidget.call(this,t,e)},t.removeWidget=function(t){var e;n.BASE.removeWidget.call(this,t),t instanceof DlTreeItem&&(t=this.__treeItems.indexOf(t),this.__treeItems.splice(t,1),0==(e=this.__treeItems.length)?this.parent instanceof DlTreeItem&&this.destroy():(0==t&&this.__treeItems[t]._setFirstLast(!0,null),t==e&&this.__treeItems[t-1]._setFirstLast(null,!0)))},t._appendWidgetElement=function(t,e){var n=this.__treeItems,i=this.getContentElement();if(null==e)t instanceof DlTreeItem&&((s=n.peek())?s._setFirstLast(null,!1):t._setFirstLast(!0,null),n.push(t),t._setFirstLast(null,!0)),i.appendChild(t.getElement());else{if(e==n.length)return this._appendWidgetElement(t,null);var s=n[e];s&&s._setFirstLast(!1,e==n.length-1),t._setFirstLast(0==e,!1),n.splice(e,0,t),i.insertBefore(t.getElement(),i.childNodes[e])}},t.addSeparator=function(t){e.createElement("div",null,{className:t||"DlTree-separator",innerHTML:"&nbsp;"},this.getElement())}}),DEFINE_CLASS("DlTreeItem",DlContainer,function(e,t,n){n.createElement;var s=n.addClass,i=n.delClass,o=n.condClass;e.CONSTRUCT=function(){this.setIconClass(this.__iconClass),this.__iconClass=null},e.DEFAULT_ARGS={__label:["label",null],__iconClass:["iconClass",null],__itemClass:["itemClassName",null]},e.DEFAULT_EVENTS=["onExpand","onCollapse","onLabelMouseDown"];function l(t){t=function(t){var e=t.target;try{for(;e&&"td"!=e.tagName.toLowerCase();)e=e.parentNode}catch(t){e=null}return e}(t);if(t&&/DlTreeItem-(Expander|Icon)/.test(t.className))throw this.toggle(),new DlExStopEventBubbling}function r(){var t=this.getSubtreeDiv();window.DL_CLOSING||n.trash(t),n.removeEvent(this.getDivElement(),"mousedown",this.__onLabelMouseDown)}t._setFirstLast=function(t,e){null!=t&&(this.condClass(t,"DlTreeItem-First"),o(this.getTableElement(),t,"DlTreeItem-First")),null!=e&&(this.condClass(e,"DlTreeItem-Last"),o(this.getTableElement(),e,"DlTreeItem-Last"))},t._setListeners=function(){e.BASE._setListeners.call(this),this.addEventListener({onMouseDown:l,onDestroy:r})},t._createElement=function(){e.BASE._createElement.call(this),this.getElement().innerHTML="<div class='DlTreeItem-div'><table cellspacing='0' cellpadding='0' class='DlTreeItem-Table'><tbody><tr><td class='DlTreeItem-Expander'><div class='DlTree-IconWidth'>&nbsp;</div></td><td></td><td class='DlTreeItem-Label'></td></tr></tbody></table></div><div class='DlTreeItem-Subtree'></div>",this.__label&&this.setContent(this.__label),this.setUnselectable(),this.__onLabelMouseDown=this._onLabelMouseDown.$(this),n.addEvent(this.getDivElement(),"mousedown",this.__onLabelMouseDown),this.__itemClass&&s(this.getDivElement(),this.__itemClass)},t._onLabelMouseDown=function(t){this.callHooks("onLabelMouseDown")},t.getDivElement=function(){return this.getElement().firstChild},t.getTableElement=function(){return this.getElement().firstChild.firstChild},t.getExpanderElement=function(){return this.getTableElement().rows[0].cells[0]},t.getIconElement=function(){return this.getTableElement().rows[0].cells[1]},t.getContentElement=function(){return this.getTableElement().rows[0].cells[2]},t.getSubtreeDiv=function(){return this.getElement().childNodes[1]},t.getSubtreeWidget=function(){return this._subtree},t.getIndex=function(){return this.parent.__treeItems.indexOf(this)},t.getParentItem=function(){return this.parent.parent},t.addSubItem=function(t,e){var n=this.getSubtreeWidget();n||this._tree||(n=new DlTree({}),this.setTree(n),this.expand()),n.appendWidget(t,e)},t.setTree=function(t,e,n){this._tree&&"function"!=typeof this._tree&&this.removeWidget(this._tree),null!=(this._tree=t)&&("function"!=typeof t?this.appendWidget(t,!0):null==e&&(e=!1),e?this.expand(e):(this.getSubtreeDiv().style.display="none",this.updateExpanderState())),null==n?(this._subtreeNeverExpires=!0,this._subtreeExpires=null):(this._subtreeNeverExpires=!1,this._subtreeExpires=(new Date).getTime()+n),this.condClass(t,"DlTreeItem-hasSubtree"),this.updateExpanderState()},t.isExpanded=function(){return"none"!==this.getSubtreeDiv().style.display},t.toggle=function(){this.expand(!this.isExpanded())},t.getPath=function(){for(var t=[],e=this.getParentItem();e instanceof DlTreeItem;)t.push(e),e=e.getParentItem();return t},t.expandParents=function(t){for(var e=this.getParentItem();e instanceof DlTreeItem;)e.expand(t),e=e.getParentItem()},t.expand=function(t,e){var n,i=this;function s(){i.getSubtreeDiv().style.display=t?"block":"none",i.updateExpanderState(),e||i.callHooks(t?"onExpand":"onCollapse")}function o(t,e){var n=i._tree;if(i._subtree)try{i._subtree.destroy()}catch(t){}i._tree=n,null==e?(i._subtreeNeverExpires=!0,i._subtreeExpires=null):(i._subtreeNeverExpires=!1,i._subtreeExpires=(new Date).getTime()+e),i.appendWidget(t,!0),s()}(t=null==t?!0:t)!==this.isExpanded()&&(!t||"function"!=typeof this._tree||this._subtree&&(this._subtreeNeverExpires||(n=(new Date).getTime(),this._subtreeExpires&&n<=this._subtreeExpires))?s():this._tree(o,this))},t.setIconClass=function(t){var e=this.getIconElement();o(e,null!=t,"DlTreeItem-Icon"),this.iconClass&&(e.innerHTML="",i(e,this.iconClass)),t&&(e.innerHTML="<div class='DlTree-IconWidth'>&nbsp;</div>",s(e,t)),this.iconClass=t},t.updateExpanderState=function(){var t,e=this.getExpanderElement().firstChild;this._tree?(t=this.isExpanded(),o(e,t,"DlTreeItem-Arrow-Expanded","DlTreeItem-Arrow-Collapsed"),o(this.getTableElement(),t,"DlTreeItem-Table-Expanded","DlTreeItem-Table-Collapsed")):(i(e,"DlTreeItem-Arrow-Expanded"),i(e,"DlTreeItem-Arrow-Collapsed"),this.delClass("DlTreeItem-hasSubtree"))},t._appendWidgetElement=function(t,e){var n,i=t.getElement();t instanceof DlTreeItem?this.addSubItem(t,e):(n=e||t instanceof DlTree?this.getSubtreeDiv():this.getContentElement(),e&&(this._subtree=t,s(i,"DlTree-withLines"),this.addClass("DlTreeItem-hasSubtree")),n.appendChild(i))},t._removeWidgetElement=function(t){e.BASE._removeWidgetElement.call(this,t),this.getSubtreeDiv().firstChild||(this._tree=null,this._subtree=null),this.updateExpanderState()},t._setFocusedStyle=function(t){o(this.getDivElement(),t,"DlTreeItem-div-focus")}}),DlType.TYPES={},DlType.prototype={getDisplayValue:function(t){return t},compare:function(t,e){throw"No comparator for type: "+this.name}},DEFINE_CLASS("DlUploadEntry",DlWidget,function(e,t,n){function l(t){is_ie&&(t=this.ownerDocument.parentWindow.event),this.firstChild.style.right=30-t.clientX+"px"}e.DEFAULT_EVENTS=["onUploadStart","onUploadEnd","onChange"],e.DEFAULT_ARGS={_url:["url",null],_files:["files",["file"]],_params:["params",null]},e.BEFORE_BASE=function(){this._files instanceof Array||(this._files=[this._files])},t._createElement=function(){e.BASE._createElement.call(this);var t=n.createElement("iframe",null,{frameBorder:0,marginHeight:0,marginWidth:0,allowTransparency:!0,src:is_ie?"javascript:'';":"about:blank"},this.getElement());this.refNode("_iframe",t)},t.init=function(){var e=String.buffer("<html style='margin: 0; padding: 0; overflow: hidden; height: 100%;'>","<head>","<link type='text/css' rel='stylesheet' href='",Dynarch.getFileURL("css/uploadentry.css"),"' />","</head>","<body>","<form action='",this._url,"' method='POST' encoding='multipart/form-data'>","<input type='hidden' name='_uploaderID' value='",this.getWidgetId(),"' />"),t=this._params;if(t)for(var n in t=t instanceof Array?t.toHash(""):t)e("<input type='hidden' name='",n,"' value='",t[n],"' />");this._files.foreach(function(t){e("<label class='upload'><input type='file' name='",t,"' /></label>")}),e("</form></body></html>");var i=this._iframe.contentWindow,s=i.document,o=(s.open(),s.write(e.get()),s.close(),this.refNode("_win",i),this.refNode("_doc",s),this.refNode("_form",s.getElementsByTagName("form")[0]),this._form.method="POST",this._form.encoding="multipart/form-data",function(t){t.applyHooks("onChange",[this,this.name,this.value])}.$(null,this));this._files.foreach(function(t){t=this._form.elements.namedItem(t);t.onchange=o,t.parentNode.onmousemove=l},this)},t.setParam=function(t,e){if("string"==typeof t){var n=this.getField(t);n||((n=this._doc.createElement("input")).type="hidden",n.name=t,this._form.appendChild(n)),n.value=e}else for(var i in t)this.setParam(i,t[i])},t.getParam=function(t){t=this.getField(t);return t&&t.value},t.getField=function(t){return this._form.elements.namedItem(t)},t.submit=function(){this.callHooks("onUploadStart"),this._form.submit()},e.finishUpload=function(t){if(!(t=t instanceof DlUploadEntry?t:DlWidget.getById(t)))throw"No such uploader: "+t;t.init(),t.applyHooks("onUploadEnd",Array.$(arguments,1))}}),DEFINE_EXCEPTION("DlValidatorException"),DlValidatorException.MISMATCH=1,DlValidatorException.TOO_SMALL=2,DlValidatorException.TOO_BIG=3,DEFINE_CLASS("DlValidator",null,function(e,t){e.CONSTRUCT=function(t){t&&("string"==typeof t&&(t=e[t]),this._callback=t,this._args=1<arguments.length?Array.$(arguments,1):null)},t.ok=function(t){if(void 0!==this._lastData&&this._lastData===t)return!0;try{var e=[t].concat(this._args||Array.$(arguments,1)),n=this._callback.apply(this,e);return this._lastData=t,this._lastValue=n,!0}catch(t){if(t instanceof DlValidatorException)return this._error=t,!1;throw t}},t.getLastVal=function(){return this._lastValue},t.getLastData=function(){return this._lastData},t.getError=function(){return this._error},e.Number=function(t,e,n,i,s){t=t.replace(/\s/g,"");t=new Number(t);if(isNaN(t))throw new DlValidatorException("Value must be numeric",DlValidatorException.MISMATCH);if(i&&t!=Math.round(t))throw new DlValidatorException("Value must be an integer",DlValidatorException.MISMATCH);if(null!=e&&t<e)throw new DlValidatorException("Value must be bigger than "+e,DlValidatorException.TOO_SMALL);if(null!=n&&n<t)throw new DlValidatorException("Value must be smaller than "+n,DlValidatorException.TOO_BIG);return t=s?t.toFixed(s):t},e.Email=function(t){if(t=t.trim(),/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i.test(t))return t;throw new DlValidatorException("That doesn't look like an email address",DlValidatorException.MISMATCH)},e.URL=function(t,e){if(t=t.trim(),/^(https?|ftps?):\x2f\x2f/.test(t))return t;if(/^([a-z0-9_-]+\.)+[a-z]+$/i.test(t))return"http://"+(t=/^www\./.test(t)?t:"www."+t)+"/";throw new DlValidatorException("Value must be an absolute URL",DlValidatorException.MISMATCH)},e.Date=function(t,e,i){if(!/\S/.test(t))return"";e=e||"%Y-%m-%d",t=t.replace(/^\s+/,"").replace(/\s+$/,"");var n=new Date,s=null,o=null,l=null,r=null,a=null,u=null,h=t.match(/([0-9]{1,2}):([0-9]{1,2})(:[0-9]{1,2})?\s*(am|pm)?/i),h=(h&&(r=parseInt(h[1],10),a=parseInt(h[2],10),u=h[3]?parseInt(h[3].substr(1),10):0,t=t.substring(0,h.index)+t.substr(h.index+h[0].length),h[4])&&("pm"==h[4].toLowerCase()&&r<12?r+=12:"am"==h[4].toLowerCase()&&12<=r&&(r-=12)),t.split(/\W+/)),c=[];if(h.foreach(function(t){function e(t){return t.foreach(function(t,e){0==t.toLowerCase().indexOf(n)&&$RETURN(e)})}var n;/^[0-9]{4}$/.test(t)?(s=parseInt(t,10),o||l||null!=i||(i=!0)):/^[0-9]{1,2}$/.test(t)?60<=(t=parseInt(t,10))?s=t:0<=t&&t<=12?c.push(t):1<=t&&t<=31&&(l=t):(n=(n=t).toLowerCase(),null!=(t=e(DlTEXTS._date_shortMonthNames)||e(DlTEXTS._date_monthNames))&&t++,o=t)}),2<=c.length?i?(o=o||c.shift(),l=l||c.shift()):(l=l||c.shift(),o=o||c.shift()):1==c.length&&(l?o=o||c.shift():l=c.shift()),(s=s||(0<c.length?c.shift():n.getFullYear()))<30?s+=2e3:s<99&&(s+=1900),o=o||n.getMonth()+1,s&&o&&l)return this._date=new Date(s,o-1,l,r,a,u),this._date.print(e);throw this._date=null,new DlValidatorException("Can't figure out this date",DlValidatorException.MISMATCH)}}),DlConsole.prototype={log:function(t){t=t.printf.apply(t,Array.$(arguments,1)),this._addMsg({str:t})},line:function(){this._addMsg({str:"&nbsp;",cls:"sep"})},CC:function(t,e){var n=this.win.document.createElement("div");n.className=e||"msg",n.innerHTML=t,this.win.document.body.appendChild(n),this.win.scrollTo(0,n.offsetTop+n.offsetHeight),this._last&&DynarchDomUtils.delClass(this._last,"current"),DynarchDomUtils.addClass(n,"current"),this._last=n},_addMsg:function(t){this._init(),this.win?this.CC(t.str,t.cls):this._messages.push(t)},_init:function(){this.win||window.open(Dynarch.getFileURL("html/dlconsole.html"),"DlConsole","height=400,width=600,menubar=0,toolbar=0,scrollbars=1")},_loaded:function(t){this._last=null,this.win=t,this.log("<b>DynarchLIB Console</b><br />Initialized at %s",new Date),this.line(),this._messages.foreach(this._addMsg,this)},protect:function(name){var func=eval(name),f=function(){try{for(var t=[],e=0;e<arguments.length;++e)t.push(arguments[e]);console.log(name+" ["+t.join(", ")+"]"),func.apply(this,arguments)}catch(t){throw alert("Exception in "+name+"\n"+t),t}};eval(name+" = f")}},window.dlconsole||(window.dlconsole=new DlConsole);