/*
 * DynarchLIB version: 2.0
 *                                                                ____   _____
 * A lightweight JavaScript toolkit for professionals.            \  /_  /   /
 *                                                                 \  / /   /
 * Copyright (c) Dynarch.com 2005-2009.  All rights reserved.       \/ /_  /
 * See http://www.dynarchlib.com/licensing for licensing details.    \  / /
 *                                                                     / /
 *          this package built at 2009/12/09 14:30 GMT                 \/
 */
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",false,true)}catch(e){}var CE_CACHE={HTML_ESCAPE_DIV:document.createElement("div"),HTML_ESCAPE_TEXT:document.createTextNode("")};CE_CACHE.HTML_ESCAPE_DIV.appendChild(CE_CACHE.HTML_ESCAPE_TEXT);Array.$=function(g,k){if(k==null){k=0}var b,f,c;try{b=Array.prototype.slice.call(g,k)}catch(d){b=new Array(g.length-k);for(f=k,c=0;f<g.length;++f,++c){b[c]=g[f]}}return b};Object.merge=function(a,c){for(var b in c){a[b]=c[b]}};Object.merge(Object,{mergeDefined:function(a,c){for(var b in c){if(typeof c[b]!="undefined"){a[b]=c[b]}}},mergeUndefined:function(a,c){for(var b in c){if(!(b in a)){a[b]=c[b]}}},remove:function(c,b){for(var a=b.length;--a>=0;){delete c[b[a]]}},isEmpty:function(b){for(var a in b){return false}return true},makeCopy:function(c){var b,a={};for(b in c){a[b]=c[b]}return a},makeDeepCopy:function(f){if(f instanceof Array){var b=[],d=f.length;while(--d>=0){b[d]=Object.makeDeepCopy(f[d])}return b}if(f===null){return null}if(f instanceof Date){return new Date(f)}if(f instanceof Object){var d,c={};for(d in f){c[d]=Object.makeDeepCopy(f[d])}return c}return f},makeShortcuts:function(c,b){for(var a in b){c[a]=c[b[a]]}},foreach:function(g,c,d){for(var b in g){try{c.call(d,g[b],b)}catch(a){if(a===$_BREAK){break}if(a===$_CONTINUE){continue}if(a instanceof $_RETURN){return a.args}throw a}}}});Object.merge(Function,{INHERITANCE:{},getInheritanceGraph:function(){return Function.INHERITANCE},noop:function(){},identity:function(a){return a},returnTrue:function(){return true},returnFalse:function(){return false},invoke:function(a){return a()}});var $__JSOOP=new Function.noop;Object.merge(Function.prototype,{$:Function.prototype.closure=function(c){var a=Array.$(arguments,1),b=this;if(c==window.undefined){return function(){return b.apply(this,a.concat(Array.$(arguments)))}}else{return function(){return b.apply(c,a.concat(Array.$(arguments)))}}},$0:function(c){var b=this,a=Array.$(arguments,1);return function(){return b.apply(c,a)}},inherits:function(b,a){var c=(this.prototype=new b($__JSOOP));c.constructor=this;this.BASE=b.prototype;Function.INHERITANCE[this.name=this._objectType=c._objectType=a||Dynarch.getFunctionName(this)]=Dynarch.getFunctionName(b);return this.BASE},setDefaults:function(c,b,a){return Dynarch.setDefaults.call(c,this.DEFAULT_ARGS,b,a)},$$:function(b){return this.$.apply(this,b)},$A:function(c,b){return this.$.apply(this,[c].concat(b))},$C:function(){var a=Array.$(arguments),b=this;return function(){return b.apply(null,a.concat(Array.$(arguments)))}},inverse:function(){var a=this;return function(){return !a.apply(this,arguments)}},clearingTimeout:function(d,g){var i=null,b=this,a=Array.$(arguments,2),c=function(){i&&clearTimeout(i);i=setTimeout(b.$A(g==null?this:g,a.concat(Array.$(arguments))),d)};c.cancel=function(){clearTimeout(i)};c.doItNow=function(){clearTimeout(i);b.apply(g,a.concat(Array.$(arguments)))};return c},rarify:function(c,g){var d=this.$$(Array.$(arguments,2)),k=this.clearingTimeout.apply(this,Array.$(arguments,1)),b=c,j=null,a=function(){b=c};return function(){j&&clearTimeout(j);j=setTimeout(a,g);if(b-->0){return d.apply(this,arguments)}return k.apply(this,arguments)}},delayed:function(b){var a=arguments.length>1?this.$$(Array.$(arguments,1)):this;return setTimeout(a,b)},setInterval:function(b){var a=arguments.length>1?this.$$(Array.$(arguments,1)):this;setTimeout(a,0);return setInterval(a,b)},inject:function(a){if(a==null){a=this.OBJECT_EXTENSIONS}Object.merge(this.prototype,a);return this}});Object.merge(Array,{hashKeys:function(f){var b=[],d=0,c;for(c in f){b[d++]=c}return b},hashValues:function(f){var b=[],d=0,c;for(c in f){b[d++]=f[c]}return b}});function $_YIELD(a){this.timeout=a||0}var $_BREAK={};var $_CONTINUE={};function $_RETURN(a){this.args=a}function $YIELD(a){throw new $_YIELD(a)}function $BREAK(){throw $_BREAK}function $CONTINUE(){throw $_CONTINUE}function $RETURN(a){throw new $_RETURN(a)}Array.inject({map_hash:function(b,c,a){a||(a={});this.foreach(b instanceof Function?function(d){a[d]=b.call(c,d)}:function(d){a[d]=b[d]});return a},accumulate:function(b,c){if(arguments.length<2){c=0}for(var a=0;a<this.length;++a){c=b(this[a],c,a)}return c},foreach:function(d,g){if(g==null){g=this}var c=0,a=this.length;while(a-->0){try{d.call(g,this[c],c++)}catch(b){if(b===$_BREAK){break}if(b===$_CONTINUE){continue}if(b instanceof $_RETURN){return b.args}throw b}}},r_foreach:function(c,d){if(d==null){d=this}for(var b=this.length;--b>=0;){try{c.call(d,this[b],b)}catch(a){if(a===$_BREAK){break}if(a===$_CONTINUE){continue}if(a instanceof $_RETURN){return a.args}throw a}}},assign_each:function(a,b){return this.foreach(function(d,c){this[c]=a.call(b,c,d)})},r_assign_each:function(a,b){return this.r_foreach(function(d,c){this[c]=a.call(b,c,d)})},toHash:function(c,b){var a={};if(c instanceof Function){this.foreach(function(f,d){a[f]=c.call(b,f,d)})}else{this.foreach(function(f,d){a[f]=c!=null?c:(d+1)})}return a},toHash2:function(){var b={},a=0;while(a<this.length){b[this[a++]]=this[a++]}return b},toHash3:function(a,c){var b={};if(a instanceof Function){this.foreach(function(g,f){var d=a.call(c!=null?c:g,g,f);b[d[0]]=d[1]})}else{this.foreach(function(d){b[d[a]]=d})}return b},map:function(m,n){var j=0,c=this.length,b=[],d,k;if(!(m instanceof Function)){d=Array.$(arguments,1);while(c-->0){n=this[j];k=n[m];b[j++]=(k instanceof Function)?k.apply(n,d):k}}else{if(n==null){n=this}while(c-->0){try{b.push(m.call(n,this[j],j++))}catch(g){if(g===$_BREAK){break}if(g===$_CONTINUE){continue}if(g instanceof $_RETURN){b.push(g.args);break}throw g}}}return b},r_map:function(j,k){var d=this.length,b=[],g;if(!(j instanceof Function)){args=Array.$(arguments,1);while(--d>=0){k=this[d];g=k[j];b[d]=(g instanceof Function)?g.apply(k,args):g}}else{if(k==null){k=this}while(--d>=0){try{b.push(j.call(k,this[d],d))}catch(c){if(c===$_BREAK){break}if(c===$_CONTINUE){continue}if(c instanceof $_RETURN){b.push(c.args);break}throw c}}}return b.reverse()},keys_map:function(a){return this.map(function(b){return a[b]})},grep:function(j,m){var f=0,c=this.length,b=[],g,d,k;if(j instanceof RegExp){while(c-->0){g=this[f++];j.test(g)&&b.push(g)}}else{if(j instanceof Function){if(m==null){m=this}while(c-->0){g=this[f];j.call(m,g,f++)&&b.push(g)}}else{d=Array.$(arguments,1);while(c-->0){m=this[f++];k=m[j];if(m[j] instanceof Function){m[j].apply(m,d)&&b.push(m)}else{if(m[j]){b.push(m)}}}}}return b},grep_last:function(c,a){if(a==null){a=this.length-1}while(a>=0){var b=this[a--];if(c(b)){return b}}return null},grep_first:function(c,a){for(a=a||0;a<this.length;++a){var b=this[a];if(c(b)){return b}}return null},contains:function(b){for(var a=this.length;--a>=0;){if(this[a]===b){return true}}return false},find:function(b){for(var a=this.length;--a>=0;){if(this[a]===b){return a}}return -1},remove:function(b){for(var a=this.length;--a>=0;){if(this[a]===b){this.splice(a,1)}}return this},pushUnique:function(a){if(this.find(a)<0){this.push(a);return this.length}return null},peek:function(){if(this.length>0){return this[this.length-1]}},min:function(c,d){if(this.length==0){return null}if(arguments.length>0){var b=c!=null?c.call(d,this[0],0):this[0];for(var a=1;a<this.length;++a){b=Math.min(b,(c!=null?c.call(d,this[a],a):this[a]))}return b}return Math.min.apply(Math,this)},minElement:function(k,l,a){if(this.length==0){return null}var d=0,g=this[0],j=k.call(l,g),b=0,c;while(++d<this.length){if((c=k.call(l,this[d]))<j){j=c;b=d;g=this[d]}}if(a){this.splice(b,1)}return g},max:function(c,d){if(this.length==0){return null}if(arguments.length>0){var a=c!=null?c.call(d,this[0],0):this[0];for(var b=1;b<this.length;++b){a=Math.max(a,(c!=null?c.call(d,this[b],b):this[b]))}return a}return Math.max.apply(Math,this)},maxElement:function(j,l,b){if(this.length==0){return null}var g=0,a=this[0],k=j.call(l,a),d=0,c;while(++g<this.length){if((c=j.call(l,this[g]))>k){k=c;d=g;a=this[g]}}if(b){this.splice(d,1)}return a},rotateIndex:function(a){return Math.rotateLimit(a,0,this.length-1)},limitIndex:function(a){return Math.limit(a,0,this.length-1)},nullLimitIndex:function(a){return Math.nullLimit(a,0,this.length-1)},bytesToString:function(){var b=String.buffer(),a=0,d;while(a<this.length){d=this[a++];if(!(d&240^240)){d=((d&3)<<18)|((this[a++]&63)<<12)|((this[a++]&63)<<6)|(this[a++]&63)}else{if(!(d&224^224)){d=((d&15)<<12)|((this[a++]&63)<<6)|(this[a++]&63)}else{if(!(d&192^192)){d=((d&31)<<6)|(this[a++]&63)}}}b(String.fromCharCode(d))}return b.get()},repeat:function(a){if(a==0){return[]}if(a==1){return this}var b=this.repeat(a>>1);b=b.concat(b);if(a&1){b=b.concat(this)}return b},common_prefix:function(){switch(this.length){case 0:return"";case 1:return this[0];case 2:var d=this[0],c=this[1],g=Math.min(d.length,c.length),f=0;while(f<g&&d.charAt(f)===c.charAt(f)){++f}return d.substring(0,f);default:return[this[0],this.slice(1).common_prefix()].common_prefix()}},append:function(b){this.push.apply(this,b)},prepend:function(b){this.unshift.apply(this,b)}});Number.inject({map:function(b,a){return b+(a-b)*this},reduce:function(b,a){return(this-b)/(a-b)},mapInt:function(b,a){return Math.round(this.map(b,a))},reduceInt:function(b,a){return Math.round((this-b)/(a-b))},bits1Array:function(){var f=this,b=[],c=1,d=0;while(f>0){if(f&1){b[d++]=c}c=c<<1;f=f>>1}return b},times:function(c,d){var b=this,a=0;while(--b>=0){c.call(d,a++,b)}},hex:function(a){var b=this.toString(16).toUpperCase();if(a){while(b.length<a){b="0"+b}}return b},zeroPad:function(b,c){var a=""+Math.round(this);if(c==null){c="0"}while(a.length<b){a=c+a}return a},formatTime:function(){var c=this,b,a;a=c/60;c%=60;b=a/60;a%=60;return[b,a,c].map("zeroPad",2).join(":")},toDate:function(c,d,b,a){return Date.intToDate(this,c,d,b,a)},limit:function(b,a){return Math.limit(this,b,a)},rotateLimit:function(b,a){return Math.rotateLimit(this,b,a)},nullLimit:function(b,a){return Math.nullLimit(this,b,a)}});Object.merge(Math,{nullLimit:function(c,b,a){if(c<b){c=null}if(c>a){c=null}return c},limit:function(c,b,a){if(c<b){c=b}if(c>a){c=a}return c+0},rotateLimit:function(c,b,a){a++;c=c%(a-b);if(c<0){c=a+c}else{if(c<b){c=b-c}}return c+0}});Object.merge(Date,{_MD:[31,28,31,30,31,30,31,31,30,31,30,31],SECOND:1000,MINUTE:60*1000,HOUR:60*60*1000,DAY:24*60*60*1000,WEEK:7*24*60*60*1000,_MN:DlTEXTS._date_monthNames,_SMN:DlTEXTS._date_shortMonthNames,_DN:DlTEXTS._date_dayNames,_SDN:DlTEXTS._date_shortDayNames,_FDOW:DlTEXTS._date_firstDayOfWeek,isWeekend:function(a){return a==0||a==6},parseMySQL:function(str,gmt){var a=str.split(/\s+/),d=a[0].split(/-/),t=a[1].split(/:/),date;date=new Date(d[0],d[1]-1,d[2],t[0]||null,t[1]||null,t[2]||null);if(gmt){with(date){setUTCMilliseconds(0);setUTCSeconds(t[2]||0);setUTCMinutes(t[1]||0);setUTCHours(t[0]||0);setUTCDate(1);setUTCMonth(d[1]-1);setUTCDate(d[2]);setUTCFullYear(d[0])}}return date},dateToInt:function(a){if(a instanceof Date){return 10000*a.getFullYear()+100*(a.getMonth()+1)+a.getDate()}if(typeof a=="string"){return parseInt(a,10)}return a},intToDate:function(c,f,g,d,b){if(!(c instanceof Date)){c=parseInt(c,10);var i=Math.floor(c/10000);c=c%10000;var a=Math.floor(c/100);c=c%100;c=new Date(i,a-1,c,f||12,g||0,d||0,b||0)}return c},getMonthName:function(d,c){var b=c?Date._SMN:Date._MN;return b[d%12]},getFirstDayOfWeek:function(){return Date._FDOW},getDayName:function(c,d){var b=d?Date._SDN:Date._DN;return b[c%7]}});Date.inject({toInt:function(){return Date.dateToInt(this)},getMonthDays:function(a){var b=this.getFullYear();if(a==null){a=this.getMonth()}return(((0==(b%4))&&((0!=(b%100))||(0==(b%400))))&&a==1)?29:Date._MD[a]},getDayOfYear:function(){var a=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var c=new Date(this.getFullYear(),0,0,0,0,0);var b=a-c;return Math.floor(b/Date.DAY)},getWeekNumber:function(){var c=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var b=c.getDay();c.setDate(c.getDate()-(b+6)%7+3);var a=c.valueOf();c.setMonth(0);c.setDate(4);return Math.round((a-c.valueOf())/(7*86400000))+1},dateEqualsTo:function(b,a){return this.getFullYear()==b.getFullYear()&&this.getMonth()==b.getMonth()&&(a||this.getDate()==b.getDate())},print:function(o){var b=this.getMonth();var n=this.getDate();var p=this.getFullYear();var r=this.getWeekNumber();var t=this.getDay();var z={};var u=this.getHours();var c=(u>=12);var k=(c)?(u-12):u;var x=this.getDayOfYear();if(k==0){k=12}var f=this.getMinutes();var l=this.getSeconds();z["%a"]=Date.getDayName(t,true);z["%A"]=Date.getDayName(t);z["%b"]=Date.getMonthName(b,true);z["%B"]=Date.getMonthName(b);z["%C"]=1+Math.floor(p/100);z["%d"]=(n<10)?("0"+n):n;z["%e"]=n;z["%H"]=(u<10)?("0"+u):u;z["%I"]=(k<10)?("0"+k):k;z["%j"]=(x<100)?((x<10)?("00"+x):("0"+x)):x;z["%k"]=u;z["%l"]=k;z["%m"]=(b<9)?("0"+(1+b)):(1+b);z["%M"]=(f<10)?("0"+f):f;z["%n"]="\n";z["%p"]=c?"PM":"AM";z["%P"]=c?"pm":"am";z["%s"]=Math.floor(this.getTime()/1000);z["%S"]=(l<10)?("0"+l):l;z["%t"]="\t";z["%U"]=z["%W"]=z["%V"]=(r<10)?("0"+r):r;z["%u"]=t+1;z["%w"]=t;z["%y"]=(""+p).substr(2,2);z["%Y"]=p;z["%%"]="%";var v=/%./g;return o.replace(v,function(a){return z[a]||a});var q=o.match(v);for(var j=0;j<q.length;j++){var g=z[q[j]];if(g){v=new RegExp(q[j],"g");o=o.replace(v,g)}}return o}});String.inject({breakable:function(a){if(!a){a=/([_.-])/g}return this.replace(a,"$1<span class='BreakPoint'> </span>")},printf:function(){var b=Array.$(arguments),c=0;return this.replace(/%[sdfo%]/g,function(d){d=d.charAt(1);var a=b[c++];switch(d){case"s":return a.toString();case"d":return parseInt(a);case"f":return parseFloat(a).toFixed(3);case"o":return a;case"%":return"%"}return"undefined"})},fixedWidth:function(a){return String.buffer("<div style='width:",a,"'>",this,"</div>").get()},noWrap:function(){return this.replace(/\x20/g,"&nbsp;")},lastIndexOfRegexp:function(b,c){var a,d=0;b.lastIndex=0;b.global=true;while((a=b.exec(this))){if(b.lastIndex>=c){break}d=b.lastIndex}return d},hashWords:function(a){return this.trim().split(/\s+/).toHash(arguments.length>0?a:true)},arrayWords:function(){return this.trim().split(/\s+/)},trim:function(a,c){var b=a?this:this.replace(/^\s+/,"");if(!c){b=b.replace(/\s+$/,"")}return b},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(a){return DlJSON.decode(this,a)},makeLabel:function(){return this.replace(/\s+/g,"&nbsp;")},capitalizeString:function(){return this.charAt(0).toUpperCase()+this.substr(1)},htmlEmbed:function(b,f){var d=["<",b];if(f!=null){d.push(" class='",f,"'")}d.push(">",this,"</",b,">");return d.join("")},repeat:function(a){if(a==0){return""}if(a==1){return""+this}var b=this.repeat(a>>1);b+=b;if(a&1){b+=this}return b},hexToBytes:function(c){var b=[],d=0,f=this;if(c){f=f.replace(/[^0-9a-f]/ig,"")}if(f.length&1){f="0"+f}while(d<f.length){b.push(parseInt(f.substr(d,2),16));d++;d++}return b},toBytes:function(){var b=[],g=this.length,f=0,d=0,l;while(--g>=0){l=this.charCodeAt(d++);if(l<128){b[f++]=l}else{if(l<2048){b[f++]=192|((l>>>6)&31);b[f++]=128|(l&63)}else{if(l<65536){b[f++]=224|((l>>>12)&15);b[f++]=128|((l>>>6)&63);b[f++]=128|(l&63)}else{if(l<1114112){b[f++]=240|((l>>>18)&3);b[f++]=128|((l>>>12)&63);b[f++]=128|((l>>>6)&63);b[f++]=128|(l&63)}}}}}return b}});(function(){var j=navigator.userAgent;is_opera=/opera/i.test(j);is_ie=/msie/i.test(j)&&!is_opera&&!(/mac_powerpc/i.test(j));is_ie5=is_ie&&/msie 5\.[^5]/i.test(j);is_ie6=is_ie&&/msie 6/i.test(j);is_ie7=is_ie&&/msie 7/i.test(j);is_ie8=is_ie&&/msie 8/i.test(j);ie_box_model=is_ie&&document.compatMode&&document.compatMode=="BackCompat";is_mac_ie=/msie.*mac/i.test(j);is_khtml=/Konqueror|Safari|KHTML/i.test(j);is_safari=/Safari/i.test(j);is_safari3=is_safari&&/Version\/3/i.test(j);is_konqueror=is_khtml&&!is_safari3;is_gecko=/gecko/i.test(j)&&!is_khtml&&!is_opera&&!is_ie;is_chrome=/Chrome/i.test(j);is_w3=!is_ie;is_macintosh=/Macintosh/i.test(j);if(is_gecko&&/rv:\s*([0-9.]+)/.test(j)){gecko_version=parseFloat(RegExp.$1)}var c=Array.prototype,a=Date.prototype,d=String.prototype,i=Number.prototype;function l(n,m){if(m){if(n instanceof Function){return function(p,o){return n(o,p)}}else{return function(o,p){return(p<o)?-1:((p>o)?1:0)}}}else{if(n instanceof Function){return n}else{return function(p,o){return(p<o)?-1:((p>o)?1:0)}}}}c.mergeSort=function(n,m){if(this.length<2){return Array.$(this)}var o=l(n,m);function q(u,t){var x=[],s=0,v=0,w=0;while(s<u.length&&v<t.length){o(u[s],t[v])<=0?x[w++]=u[s++]:x[w++]=t[v++]}if(s<u.length){x.push.apply(x,u.slice(s))}if(v<t.length){x.push.apply(x,t.slice(v))}return x}function p(s){if(s.length<=1){return s}var r=Math.floor(s.length/2),u=s.slice(0,r),t=s.slice(r);u=p(u);t=p(t);return q(u,t)}return p(this)};c.qsort=function(r,o){if(this.length<2){return}var s=l(r,o),m=this,p,n=false;function q(x,w){var v=x,u=w,t=false;if(v<u){do{if(s(m[v],m[u])>0){p=m[v];m[v]=m[u];m[u]=p;t=!t;n=true}t?--u:++v}while(v<u);q(x,v-1);q(v+1,w)}}q(0,this.length-1);return n};c.x=c.repeat;var g=i.$1K=1024,f=i.$1M=g*1024,k=i.$1G=f*1024,b=i.$1T=k*1024;i.formatBytes=function(o){var p=this,m,n;if(p<g){m="B"}else{if(p<f){p/=g;m="K"}else{if(p<k){p/=f;m="M"}else{if(p<b){p/=k;m="G"}}}}n=Math.round(p);if(o&&p!=n){return p.toFixed(o)+m}else{return n+m}};d.qw=d.arrayWords;d.bold=d.htmlEmbed.$(window.undefined,"b");d.x=d.repeat})();Object.merge(String,{firstNonEmpty:function(){for(var a=0;a<arguments.length;++a){var b=arguments[a];if(/\S/.test(b)){return b}}},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){if(p1.charAt(0)=="\\"){return s.substr(1)}if(p2.charAt(0)=="{"){p2=p2.substr(1,p2.length-2)}eval("p2 = props."+p2);return p1+p2})}},buffer:is_ie||is_khtml?function(){var c=[],b=0,d=function(){for(var a=0;a<arguments.length;++a){c[b++]=arguments[a]}return d};d.get=function(){c=[c.join("")];b=1;return c[0]};if(arguments.length>0){d.apply(this,arguments)}return d}:function(){var b="",a=function(){b=b.concat.apply(b,arguments);return a};if(arguments.length>0){a.apply(this,arguments)}a.get=function(){return b};return a}});String.prototype.htmlEscape=is_gecko?function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00A0/g,"&#xa0;")}:function(){CE_CACHE.HTML_ESCAPE_TEXT.data=this;return CE_CACHE.HTML_ESCAPE_DIV.innerHTML};window.Dynarch={setDefaults:function(f,b,a){if(!b){b={}}var c,g,d;for(c in f){if(a||!(c in this)){d=f[c];if(d instanceof Array){if(d[0]!=null){g=d[0];if(g in b){g=b[g]}else{g=d[1]}}else{g=d[1]}}else{g=d}this[c]=g}}},__IDS:{},ID:function(b){var a=Dynarch.__IDS;if(b==null){b="generic"}if(!(b in a)){a[b]=0}return"dynarch-"+b+"-"+(++a[b])},getFunctionName:function(a){if(a.name){return a.name}else{if(/function\s+(\$?[a-z0-9_]+)\(/i.test(a.toString())){return RegExp.$1}}return"UNKNOWN_FUNCTION"},EXPORT:function(b,c){var a=String.buffer("var D=window.",b,"=",b,",P=",b,".prototype;");if(c){a(DynarchDomUtils.importCommonVars())}return a.get()},getBaseURL:function(){var b=window.Dynarch_Base_Url;if(!b){var a=document.getElementsByTagName("script"),c=0,d;while((d=a[c++])){if(d.className=="DynarchLIB"){b=d.src;if(/^(.*)\x2fjs\x2f/.test(b)){Dynarch_Base_Url=b=RegExp.$1;break}}}}return b},getFileURL:function(a){return Dynarch.getBaseURL()+"/"+a}};window.DynarchDomUtils={ID:Dynarch.ID,related:function(b,d){var f,c;if(is_ie){c=d.type;if(c=="mouseover"){f=d.fromElement}else{if(c=="mouseout"){f=d.toElement}}}else{f=d.relatedTarget}if(is_gecko&&f){try{f.parentNode}catch(a){try{f=d.parentNode}catch(a){f=d.target}}}try{for(;f;f=f.parentNode){if(f===b){return true}}}catch(a){return true}return false},getScrollbarSize:function(a){return{x:a.offsetWidth-a.clientWidth,y:a.offsetHeight-a.clientHeight}},addEvent:function(b,d,c){if(typeof d=="string"){if(b.addEventListener){b.addEventListener(d,c,false)}else{if(b.attachEvent){b.attachEvent("on"+d,c)}else{b["on"+d]=c}}}else{if(d instanceof Array){DynarchDomUtils.addEvents(b,d,c)}else{for(var a in d){DynarchDomUtils.addEvent(b,a,d[a])}}}},addEvents:function(c,a,d){for(var b=a.length;--b>=0;){DynarchDomUtils.addEvent(c,a[b],d)}},removeEvent:function(b,d,c){if(typeof d=="string"){if(b.removeEventListener){b.removeEventListener(d,c,false)}else{if(b.detachEvent){b.detachEvent("on"+d,c)}else{b["on"+d]=""}}}else{if(d instanceof Array){DynarchDomUtils.removeEvents(b,d,c)}else{for(var a in d){DynarchDomUtils.removeEvent(b,a,d[a])}}}},removeEvents:function(c,a,d){for(var b=a.length;--b>=0;){DynarchDomUtils.removeEvent(c,a[b],d)}},condEvent:function(a){a=a?DynarchDomUtils.addEvent:DynarchDomUtils.removeEvent;return a.apply(DynarchDomUtils,Array.$(arguments,1))},condEvents:function(a){a=a?DynarchDomUtils.addEvents:DynarchDomUtils.removeEvents;return a.apply(DynarchDomUtils,Array.$(arguments,1))},stopEvent:function(a){if(is_ie){a.cancelBubble=true;a.returnValue=false}else{a.preventDefault();a.stopPropagation()}return false},addLoadHandler:function(b,a){if(is_ie){b.onreadystatechange=function(){if(b.readyState==4){try{b.onreadystatechange=null}catch(c){}a()}}}else{DynarchDomUtils.addEvent(b,"load",a)}},callHandler:function(obj,method){if(obj[method] instanceof Function){return obj[method].call(obj)}else{if(typeof obj[method]=="string"){return eval(obj[method])}}},setStyleProperty:function(a,c,b){switch(c){case"float":c="styleFloat";break;default:c=c.toLowerCase().replace(/-([a-z])/g,function(d,f){return f.toUpperCase()})}a.style[c]=b},setOpacity:function(a,b){if(b!=null){if(b==""&&b!=0){is_ie?a.style.filter="":a.style.opacity=""}else{is_ie?a.style.filter="alpha(opacity="+Math.round(b*100)+")":a.style.opacity=b}return b}else{if(!is_ie){return parseFloat(a.style.opacity)}else{if(/alpha\(opacity=([0-9.])+\)/.test(a.style.opacity)){return parseFloat(RegExp.$1)}}}},getClosestParentByTagName:function(b,a){a=a.toLowerCase();while(b&&b.tagName&&b.tagName.toLowerCase()!=a){b=b.parentNode}return b},isInside:function(c,b){try{while(c){if(c===b){return true}c=c.parentNode}}catch(a){}return false},getWindowSize:function(){if(is_gecko){if(document.documentElement.clientWidth){return{x:document.documentElement.clientWidth,y:document.documentElement.clientHeight}}else{return{x:window.innerWidth,y:window.innerHeight}}}if(is_opera){return{x:window.innerWidth,y:window.innerHeight}}if(is_ie){if(!document.compatMode||document.compatMode=="BackCompat"){return{x:document.body.clientWidth,y:document.body.clientHeight}}else{return{x:document.documentElement.clientWidth,y:document.documentElement.clientHeight}}}var b=document.createElement("div"),a=b.style;a.position="absolute";a.bottom=a.right="0px";document.body.appendChild(b);a={x:b.offsetLeft,y:b.offsetTop};document.body.removeChild(b);return a},getPos:function(f){if(f.getBoundingClientRect){var i=f.getBoundingClientRect();return{x:i.left-document.documentElement.clientLeft,y:i.top-document.documentElement.clientTop}}else{if(document.getBoxObjectFor){var i=f.ownerDocument.getBoxObjectFor(f);var j={x:i.x,y:i.y};while(f.parentNode&&f.parentNode!==document.body){f=f.parentNode;j.x-=f.scrollLeft;j.y-=f.scrollTop}return j}}if(/^body$/i.test(f.tagName)){return{x:0,y:0}}var a=0,d=0,c=/^div$/i.test(f.tagName),g,b;if(c&&f.scrollLeft){a=f.scrollLeft}if(c&&f.scrollTop){d=f.scrollTop}g={x:f.offsetLeft-a,y:f.offsetTop-d};if(f.offsetParent){b=DynarchDomUtils.getPos(f.offsetParent);g.x+=b.x;g.y+=b.y}return g},getBRPos:function(b){var c=DynarchDomUtils.getPos(b),a=DynarchDomUtils.getOuterSize(b);c.x+=a.x-1;c.y+=a.y-1;return c},setPos:function(b,a,c){if(typeof a=="number"){a+="px"}if(typeof c=="number"){c+="px"}if(a!=null){b.style.left=a}if(c!=null){b.style.top=c}},createElement:function(b,c,a,g,j){var f=CE_CACHE[b],d;if(!f){f=CE_CACHE[b]=document.createElement(b)}f=f.cloneNode(false);if(c){for(d in c){if(is_ie){DynarchDomUtils.setStyleProperty(f,d,c[d])}else{f.style.setProperty(d,c[d],"")}}}if(a){for(d in a){f[d]=a[d]}}if(g){if(typeof j=="number"){j=g.childNodes[j]}if(!j){j=null}g.insertBefore(f,j)}return f},setUnselectable:function(c,b){if(b==null){b=true}if(!is_ie){b=b?"none":"normal";c.style.MozUserSelect=b;c.style.WebkitUserSelect=b;c.style.userSelect=b}else{b=b?"on":"off";var a=Array.$(c.getElementsByTagName("*"));a.push(c);a.foreach(function(d){d.setAttribute("unselectable",b)})}},addClass:function(b,c,a){DynarchDomUtils.delClass(b,a,c)},delClass:function(g,d,k){if(g){var c=g.className;if(d instanceof RegExp){c=c.replace(d," ");d=null}if(k||d){var b=c.split(/\s+/),f=b.length,j={};d&&(j[d]=1);k&&(j[k]=1);while(--f>=0){if(b[f] in j){b.splice(f,1)}}k&&b.push(k);c=b.join(" ")}g.className=c}},condClass:function(d,c,b,a){DynarchDomUtils[c?"addClass":"delClass"](d,b,a)},hasClass:function(b,a){return b.className.split(" ").contains(a)},elementIsVisible:function(a){return !!a.offsetWidth&&a.style.visibility!="hidden"},ie_getBackgroundColor:function(a){var b=document.body.createTextRange();b.moveToElementText(a);return"#"+parseInt(b.queryCommandValue("BackColor")).hex(6)},getStyle:function(b,c){var a=null;if(window.getComputedStyle){a=document.defaultView.getComputedStyle(b,"").getPropertyValue(c)}else{if(b.currentStyle){c=c.replace(/-[a-z]/g,function(d){return d.charAt(1).toUpperCase()});if(c=="backgroundColor"){a=ie_getBackgroundColor(b)}else{a=b.currentStyle[c]}}}return a},getStylePX:function(a,c){var b=parseInt(DynarchDomUtils.getStyle(a,c),10);if(isNaN(b)){b=0}return b},getBorder:function(a){return{x:a.offsetWidth-a.clientWidth,y:a.offsetHeight-a.clientHeight}},getPadding:function(d){var c,b,a=DynarchDomUtils.getStylePX;c=a(d,"padding-left")+a(d,"padding-right");b=a(d,"padding-top")+a(d,"padding-bottom");return{x:c,y:b}},getPaddingAndBorder:function(d){var c=0,b=0,a=DynarchDomUtils.getStylePX;c+=a(d,"border-left-width");c+=a(d,"border-right-width");b+=a(d,"border-top-width");b+=a(d,"border-bottom-width");c+=a(d,"padding-left");c+=a(d,"padding-right");b+=a(d,"padding-top");b+=a(d,"padding-bottom");return{x:c,y:b}},getSelectionRange:function(g){var i,c;if(is_ie){var f,d,a;f=document.selection.createRange();d=f.compareEndPoints("StartToEnd",f)==0;if(!d){f.collapse(true)}a=f.getBookmark();i=a.charCodeAt(2)-2;f=document.selection.createRange();d=f.compareEndPoints("StartToEnd",f)==0;if(!d){f.collapse(false)}a=f.getBookmark();c=a.charCodeAt(2)-2}else{i=g.selectionStart;c=g.selectionEnd}return{start:i,end:c}},setSelectionRange:function(c,f,a){if(a==null){a=f}if(f>a){var d=f;f=a;a=d}if(typeof f=="object"){a=f.end;f=f.start}if(is_ie){var b=c.createTextRange();b.collapse(true);b.moveStart("character",f);b.moveEnd("character",a-f);b.select()}else{c.setSelectionRange(f,a)}},setOuterSize:function(c,a,d){var b=DynarchDomUtils.getPaddingAndBorder(c);if(a!=null&&b.x!=NaN){a-=b.x}if(d!=null&&b.y!=NaN){d-=b.y}DynarchDomUtils.setInnerSize(c,a,d)},setInnerSize:function(c,a,d){try{if(typeof a=="number"&&a!=NaN){a=Math.abs(a)+"px"}if(typeof d=="number"&&d!=NaN){d=Math.abs(d)+"px"}if(a!=null&&a!=NaN&&!(is_ie&&a<=0)){c.style.width=a}if(d!=null&&d!=NaN&&!(is_ie&&d<=0)){c.style.height=d}}catch(b){}},getOuterSize:function(a){return{x:a.offsetWidth,y:a.offsetHeight}},getInnerSize:function(c){var b=DynarchDomUtils.getOuterSize(c);var a=DynarchDomUtils.getPaddingAndBorder(c);b.x-=a.x;b.y-=a.y;return b},importCommonVars:function(){return["var DOM=DynarchDomUtils","AC=DOM.addClass","DC=DOM.delClass","CC=DOM.condClass","CE=DOM.createElement","ID=Dynarch.ID"].join(",")},trash:function(a){var b=CE_CACHE._trash;if(!b){b=CE_CACHE._trash=DynarchDomUtils.createElement("div",{zIndex:-10000},{className:"DYNARCH-GARBAGE-COLLECTOR"},document.body)}if(a){b.appendChild(a);b.innerHTML=""}return b},createFromHtml:function(a){var b=this.trash();b.innerHTML=a;return b.firstChild},swapNodes:function(b,a){var c=b.parentNode,d=b.nextSibling;a.parentNode.replaceChild(b,a);c.insertBefore(a,d)},scrollIntoView:function(j){var m=j.parentNode;while(m&&((m.scrollHeight==m.clientHeight&&m.scrollWidth==m.clientWidth)||/table|tbody/i.test(m.tagName))){m=m.parentNode}if(m&&m!==document.body){var f=[],i=m;while(i){f.push(i);i=i.parentNode}var g=0,d=0;i=j;while(i&&i!=m){g+=i.offsetTop;d+=i.offsetLeft;i=i.offsetParent;if(f.contains(i)){if(i!=m){g-=m.offsetTop;d-=m.offsetLeft}break}}var c=g+j.offsetHeight,k=d+j.offsetWidth;if(g<m.scrollTop){m.scrollTop=g}if(g>m.scrollTop&&c>m.scrollTop+m.clientHeight){m.scrollTop=c-m.clientHeight}if(d<m.scrollLeft){m.scrollLeft=d}if(d>m.scrollLeft&&k>m.scrollLeft+m.clientWidth){m.scrollLeft=k-m.clientWidth}}},flash:function(b,c,a){if(!a){a=3}var d=setInterval(function(){b.style.visibility=(a&1)?"hidden":"";--a;if(a<0){clearInterval(d)}},c||150)},walk:function(b,c){if(!c(b)){for(var a=b.firstChild;a;a=a.nextSibling){if(a.nodeType==1){DynarchDomUtils.walk(a,c)}}}},CE_CACHE:CE_CACHE};var $=is_gecko?document.getElementById.$(document):function(a){return document.getElementById(a)};function DEFINE_CLASS(a,f,b,d){if(a){g.name=a}if(d){g.hidden=true}if(f){g.inherits(f,a)}function g(i){if(i!==$__JSOOP){if(this===window){return alert("FIXME: Constructor called without new in "+a)}if(g.FIXARGS){if(arguments.length==0){i={}}g.FIXARGS.call(this,i)}if(g.DEFAULT_ARGS){g.setDefaults(this,i)}if(g.BEFORE_BASE){g.BEFORE_BASE.apply(this,arguments)}if(f){f.apply(this,arguments)}if(g.CONSTRUCT){g.CONSTRUCT.apply(this,arguments)}}}if(a&&!d){window[a]=g}var c=g.prototype;if(b){g.DEFINITION=b;b(g,c,DynarchDomUtils)}if(c.FINISH_OBJECT_DEF instanceof Function){c.FINISH_OBJECT_DEF()}return g}function EXTEND_CLASS(b,a){a(b,b.prototype,DynarchDomUtils)}function DEFINE_HIDDEN_CLASS(a,c,b){return DEFINE_CLASS.call(this,a,c,b,true)}function DEFINE_SINGLETON(a,c,b){var d=DEFINE_HIDDEN_CLASS(a,c,b);DlSingleton.register(a,d,true);return d}DEFINE_CLASS("DlException",null,function(b,a){b.CONSTRUCT=function(d,c){this.error=this.constructor.name;if(!d){d="*** no error message given ***"}this.message=this.constructor.name+": "+d;if(c!=null){this.code=c}};a.toString=function(){var c=this.message;if(this.code){c+=" / code: "+this.code}return c}}).stopEventBubbling=function(){throw new DlExStopEventBubbling};function DEFINE_EXCEPTION(a,b){return DEFINE_CLASS(a,b||DlException)}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(c,b){c.CONSTRUCT=function(){this.__eventHooks={};this.__disHooks={};this.registerEvents(this.DEFAULT_EVENTS);this.addEventListener("onDestroy",this.__onDestroy)};b.DEFAULT_EVENTS=["onDestroy"];b.FINISH_OBJECT_DEF=function(){var d=this.constructor.DEFAULT_EVENTS;if(d){this.DEFAULT_EVENTS=this.DEFAULT_EVENTS.concat(d)}};b.__onDestroy=function(){["__eventHooks","__disHooks"].foreach(function(d){for(var f in this[d]){var g=this[d][f];if(g){g.foreach(function(k,j){this[j]=null})}this[d][f]=null}this[d]=null},this)};b.__getEventHooks=function(f,g){if(!this.__eventHooks){throw new DlExStopEventBubbling}var d=this.__eventHooks[f.toLowerCase()];if(g){d=d.slice(0)}return d};function a(d,f){return d.applyHooks(f,Array.$(arguments,2))}b.registerEvents=function(d){var g=this.__eventHooks,f=0,j;while((j=d[f++])){j=j.toLowerCase();if(!g[j]){g[j]=[]}}};b.condEventListener=function(d){d=d?this.addEventListener:this.removeEventListener;return d.apply(this,Array.$(arguments,1))};b.addEventListener=function(l,k,f,g){if(l instanceof Array){var j=0,m;while((m=l[j++])){this.addEventListener(m,k,f,g)}}else{if(typeof l=="object"){for(var j in l){this.addEventListener(j,l[j],k,f)}}else{var d=this.__getEventHooks(l);d.remove(k);if(f==null&&l.toLowerCase()=="ondestroy"){f=true}f?d.unshift(k):d.push(k);if(g){g.addEventListener("onDestroy",this.removeEventListener.$(this,l,k))}}}return this};b.listenOnce=function(g,d,j){if(j==null){j=1}var i=function(){if(--j==0){this.removeEventListener(g,i)}d.apply(this,arguments)};return this.addEventListener(g,i)};b.connectEvents=function(j,d,g){if(typeof d=="string"){g=d;d=this}else{if(!g){g=j}}if(j instanceof Array){for(var f=0;f<j.length;++f){this.connectEvents(j[f],d,g[f])}}else{this.addEventListener(j,a.$(null,d,g))}return this};b.removeEventListener=function(g,f){if(g instanceof Array){var d=0,j;while((j=g[d++])){this.removeEventListener(j,f)}}else{if(typeof g=="object"){for(var d in g){this.removeEventListener(d,g[d])}}else{this.__getEventHooks(g).remove(f)}}return this};b.removeAllListeners=function(f){if(f instanceof Array){f.foreach(this.removeAllListeners,this)}else{if(typeof f=="object"){for(var d in f){this.removeAllListeners(d)}}else{this.__getEventHooks(f).length=0}}return this};b.disableHooks=function(d){if(d instanceof Array){d.r_foreach(this.disableHooks,this)}else{d=d.toLowerCase();this.__disHooks[d]=this.__eventHooks[d];this.__eventHooks[d]=[]}return this};b.enableHooks=function(d){if(d instanceof Array){d.r_foreach(this.enableHooks,this)}else{d=d.toLowerCase();this.__eventHooks[d]=this.__disHooks[d];this.__disHooks[d]=null}return this};b.callHooks=function(f){var d=arguments.length>1?Array.$(arguments,1):[];return this.applyHooks(f,d)};b.hasHooks=function(f){var d=this.__eventHooks[f.toLowerCase()];return d&&d.length>0};b.applyHooks=function(m,j){var g=[],d,l=0,n;try{d=this.__getEventHooks(m,true);while((n=d[l++])){g.push(n.apply(this,j))}}catch(k){if(!(k instanceof DlExStopEventProcessing)){throw k}}return g};b.debug_countHooks=function(){var d={},f;for(f in this.__eventHooks){d[f]=this.__eventHooks[f].length}return d};b.invoke=function(f){var d=Array.$(arguments,1);return function(){this[f].apply(this,d.concat(Array.$(arguments)))}.$(this)};b.destroy=function(){if(!this.destroyed){this.destroying=true;this.callHooks("onDestroy");this.__eventHooks=null;this.destroying=false;this.destroyed=true}}});DEFINE_CLASS("DlEvent",null,function(a,g,l){var j=l.createElement;var d={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"};a.CONSTRUCT=function(p){this.type=p.type;this.dl_type=d[this.type]||this.type;this.ctrlKey=p.ctrlKey;if(is_macintosh){this.altGrKey=p.altKey;this.altKey=p.metaKey}else{this.altKey=p.altKey}this.shiftKey=p.shiftKey;this.button=p.button;this.focusedWidget=a.focusedWidget();if(is_ie){switch(p.button){case 0:this.button=null;break;case 1:this.button=0;break;case 2:this.button=2;break;case 4:this.button=1;break}}if(this.type.indexOf("key")==0){this.keyCode=p.keyCode;this.charCode=(is_ie||is_opera)?p.keyCode:p.charCode;this.keyStr=String.fromCharCode(this.charCode)}if(this.dl_type=="onMouseWheel"){var q;if(p.wheelDelta){q=p.wheelDelta/120}else{if(p.detail){q=-p.detail/3}}this.wheelDelta=q}this.pos={x:p.clientX,y:p.clientY};this.relPos=this.pos;if(is_ie){this.target=p.srcElement;switch(this.type){case"mouseover":this.relatedTarget=p.fromElement;break;case"mouseout":this.relatedTarget=p.toElement;break}}else{try{this.target=p.target;if(this.target.nodeType==3){this.target=this.target.parentNode}if(this.type=="mouseout"||this.type=="mouseover"){this.relatedTarget=p.relatedTarget;if(this.relatedTarget&&this.relatedTarget.nodeType==3){this.relatedTarget=this.relatedTarget.parentNode}}}catch(o){this.relatedTarget=p.explicitOriginalTarget}}};g.computePos=function(p){var o=p?(p instanceof DlWidget?p.getElement():p):document.body;var q=this.elPos=o?l.getPos(o):{x:0,y:0};return this.relPos={x:this.pos.x-q.x,y:this.pos.y-q.y,elPos:q}};g.getObject=function(q){var p=this.target;var r=this.object;if(!r){try{while(p&&!DlWidget.getFromElement(p)){p=p.parentNode}r=p?DlWidget.getFromElement(p):null}catch(o){r=null}this.object=r}if(q){r=r.getParent(q)}return r};g.getParentElement=function(o,q){if(q&&q instanceof DlWidget){q=q.getElement()}if(q&&r===q){return null}var r=this.target;try{while(r&&r.tagName.toLowerCase()!=o){r=r.parentNode;if(q&&r===q){return null}}}catch(p){r=null}return r};a.stopEvent=l.stopEvent;function b(t,o,q,s){var r=o.getObject();switch(o.type){case"click":break;case"mousedown":t._ev_mouseDown=true;t.applyHooks(o.dl_type,[o]);break;case"mouseup":var p=t._ev_mouseDown;t._ev_mouseDown=false;t.applyHooks(o.dl_type,[o]);if(p&&t._ev_mouseInside&&o.button===0){o=new DlEvent(s);o.dl_type="onClick";this.push([t,o,q,s])}break;case"mouseover":case"mouseout":if(!q||!l.related(q,s)){if(t===r){t._ev_mouseInside=o.type=="mouseover"}t.applyHooks(o.dl_type,[o])}else{o.dl_type=o.type=="mouseover"?"onMouseOver":"onMouseOut";t.applyHooks(o.dl_type,[o])}break;case"dblclick":if((is_ie||is_opera)&&!t.hasHooks("onDblClick")){o=new DlEvent(s);o.type="click";t.applyHooks(o.dl_type="onClick",[o]);break}default:t.applyHooks(o.dl_type,[o]);break}if(s&&o.domStop){l.stopEvent(s)}}var n=null;function k(){if(this===n){n=null}}a.fakeBlur=function(){if(is_safari&&n.blur){return n.blur()}var o=l.CE_CACHE.FAKE_FOCUS;if(!o){o=l.CE_CACHE.FAKE_FOCUS=j("a",null,{className:"DYNARCH-FAKE-FOCUS"},document.body)}o.focus();if(is_ie){var p=document.body.createTextRange();p.moveStart("character",0);p.collapse(true);p.select()}o.blur();window.status=""};a.focusedWidget=function(o){if(arguments.length>0&&n!==o){if(n){if(n._focusable==2){if(o._focusable<2){a.fakeBlur()}}else{n.blur()}n.removeEventListener("onDestroy",k)}n=o;if(o){o.addEventListener("onDestroy",k);var q=o.parent;while(q){q._focusedWidget=o;q=q.parent}}}return n};a.checkDisabled=function(o){while(o){if(o.disabled()){return true}o=o.parent}return false};g.destroy=function(){this.object=this.target=this.relatedTarget=null};g.stopDomEvent=function(){a.stopEvent(a.latestDomEvent)};var f=a.GLOBAL_CAPTURES={};var m="keydown keyup keypress".hashWords();a._genericEventHandler=function(t,u){t||(t=window.event);var o,p,r=t instanceof a?t:new a(t);if(u){t=u}if(r._failed){a.stopEvent(t);return}a.latestEvent=r;a.latestDomEvent=t;if(r.pos.x&&r.dl_type!="onMouseWheel"){a.latestMouseEvent=r;if(r.dl_type=="onMouseDown"){a.latestMouseDownEvent=r}}try{var v=f[r.dl_type],q;if(v){for(q=v.length;--q>=0;){v[q](r)}}if(r.type in m&&n){o=n.getElement()}else{o=r.target}var w=[];q=0;while(o){p=DlWidget.getFromElement(o);if(p){if(!a.checkDisabled(p)){w[q++]=[p,r,o,t]}if(p.__noPropEvents&&p.__noPropEvents.test(r.dl_type)){break}}o=o.parentNode}for(q=0;q<w.length;++q){b.apply(w,w[q])}}catch(s){if(s instanceof DlExStopEventBubbling){a.stopEvent(t)}else{throw s}}r.destroy()};var c=[];function i(){c.r_foreach(Function.invoke)}a._unloadHandler=i;a.captureGlobals=function(p){for(var o in p){a.captureGlobal(o,p[o])}};a.releaseGlobals=function(p){for(var o in p){a.releaseGlobal(o,p[o])}};a.captureGlobal=function(p,q){var o=f[p];if(!o){o=f[p]=[]}o.push(q)};a.releaseGlobal=function(p,q){var o=f[p];if(o){o.remove(q)}};a.atUnload=function(o){c.push(o)};l.addEvents(document,["contextmenu","click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove",is_gecko?"DOMMouseScroll":"mousewheel","keydown","keyup","keypress"],a._genericEventHandler);l.addEvent(window,"unload",i)});DEFINE_CLASS("DlWidget",DlEventProxy,function(v,g,C){var j=C.createElement,y=C.addClass,z=C.delClass,m=C.condClass,n=Dynarch.ID;v.FIXARGS=function(D){if(D.focusable==null&&D.tabIndex){D.focusable=true}};v.CONSTRUCT=function(){this.__propsUserData={};this.__refNodes=[];if(!(this._parent==null||this._parent instanceof DlContainer)){throw new DlException("Parent must be an instance of DlContainer")}this.id=n(this._objectType||"DlWidget");b[this.id]=this;this.initDOM()};v.DEFAULT_ARGS={userData:["data",null],_parent:["parent",null],_fillParent:["fillParent",null],_tagName:["tagName","div"],_dragArgs:["drag",null],_element:["element",null],_focusable:["focusable",false],_tabIndex:["tabIndex",0],_accessKey:["accessKey",null],__appendArgs:["appendArgs",window.undefined],__addClassName:["className",""],__disabled:["disabled",false],__tooltip:["tooltip",null],__contextMenu:["contextMenu",null],__tooltipTimeout:["tooltipTimeout",650],__refCnt:["_refCnt",0],__noPropEvents:["dontBubbleEvents",null]};v.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"];var b=v.WIDGETS={};v.getById=function(D){return b[D]};v.getFromElement=function(D){return D._dynarch_object};var B=null;function r(){if(!B){B=new DlTooltip({})}return B}v.getTooltip=r;g.getWidgetId=function(){return this.id};g._className=[];g.FINISH_OBJECT_DEF=function(){v.BASE.FINISH_OBJECT_DEF.call(this);(this._className=Array.$(this._className)).push(this._objectType)};var w=null;g.getResizeRect=v.getResizeRect=function(){if(!w){w=j("div",{display:"none"},{className:"Dl-ResizeRect",innerHTML:"&nbsp;"},document.body)}return w};v.debug_countHooks=function(){var D={};Array.hashKeys(DlWidget.WIDGETS).foreach(function(F){D[F]=DlWidget.WIDGETS[F].debug_countHooks()});return D};function d(){if(this.__tooltipActive){r().hide()}if(this.__contextMenu instanceof v){this.__contextMenu.destroy()}if(this.parent){try{this.parent.removeWidget(this)}catch(D){}}var F=this.getElement();if(F){F._dynarch_object=null;F._dynarch_focusable=null}this._element=null;C.trash(F);if(b[this.id]){b[this.id]=null;delete b[this.id]}F=null;this.__refNodes.r_foreach(function(G,H){this.__refNodes[H]=null;this[G]=null;delete this[G]},this);this.__refNodes=null;this.userData=null;this.__propsUserData=null}g.destroy=function(){if(this.unref()<=0){v.BASE.destroy.call(this)}};g.__onTooltipShow=function(){this.__tooltipActive=true;this.callHooks("onTooltipShow")};g.__onTooltipHide=function(){this.__tooltipActive=false;this.callHooks("onTooltipHide")};g._popupTooltip=function(){r().popup({timeout:this.__tooltipTimeout,content:this.__tooltip,anchor:this.getElement(),align:"mouse",onPopup:this.__onTooltipShow,onHide:this.__onTooltipHide,widget:this})};function p(){if(this.__tooltip){this._popupTooltip()}}function E(){r().hide()}function o(D,G){if(!D.dragging){if(Math.abs(G.pos.x-D.startPos.x)>=D.delta||Math.abs(G.pos.y-D.startPos.y)>=D.delta){D.dragging=true;D.makeElementCopy(this,G);D.applyHooks("onStartDrag",[this,G]);this.addClass(D.draggingClass)}}if(D.dragging){var F=D.elementCopy;if(F){F.style.left=G.pos.x+5+"px";F.style.top=G.pos.y+5+"px"}D.moving(this,G);DlException.stopEventBubbling()}}function a(F,G,D){this.delClass(F.draggingClass);DlEvent.releaseGlobals(F.captures);F.captures=null;c=false;if(!D){F.doDrop(this,G)}F.reset(D)}function l(D,F){if(F.button==0){var G=D.dragging&&D.canDrop;a.call(this,D,F,!G)}}function t(D,F){DlException.stopEventBubbling()}function q(D,F){DlException.stopEventBubbling()}function f(D,F){var I=F.getObject();var J=false,H=I;while(H){if(H===this){J=true;break}H=H.parent}var G=D.dropOK(this,F,I,J);DlException.stopEventBubbling()}function A(D,F){DlException.stopEventBubbling()}function s(D,F){if(F.keyCode==DlKeyboard.ESCAPE){a.call(this,D,F,true)}DlException.stopEventBubbling()}function u(D,F){DlException.stopEventBubbling()}var c=false;function i(G){r().cancel();if(this._focusable&&!G._justFocusedWidget){G._justFocusedWidget=this;if(this._focusable<2){this.focus()}}if(G.button==0){var D=this._dragArgs,F;if(D&&!c){if(D.startOK(this,G)){var H=G.getObject();if(H){H.applyHooks("onMouseLeave",[G])}c=true;D.source=this;D.captures={onMouseMove:o.$(this,D),onMouseUp:l.$(this,D),onMouseOver:t.$(this,D),onMouseOut:q.$(this,D),onMouseEnter:f.$(this,D),onMouseLeave:A.$(this,D),onContextMenu:u.$(this,D),onKeyPress:s.$(this,D)};D.startPos=G.pos;D.startElPos=this.getPos();DlEvent.captureGlobals(D.captures)}}}}function x(F){var D=this.__contextMenu;if(typeof D=="function"){D=D.call(this)}if(D){var G=this._getContextMenuPopup();G.popup({timeout:0,content:D,anchor:D.contextMenuAnchor||this.getElement(),align:D.contextMenuAlign||"mouse",widget:this,onPopup:D.contextMenuOnPopup||null,onHide:D.contextMenuOnHide||null,isContext:true});DlException.stopEventBubbling()}}g.setData=function(D,F){if(arguments.length==1){delete this.__propsUserData[D]}else{this.__propsUserData[D]=F}};g.getData=function(D){return this.__propsUserData[D]};g._getDlPopup=function(){var D=this.getParent(DlPopup)||0;if(D){D=D._level+1}return DlPopupMenu.get(D)};g._getContextMenuPopup=g._getDlPopup;var k={onDestroy:d,onMouseEnter:p,onMouseLeave:E,onMouseDown:i,onContextMenu:x};g._setListeners=function(){this.addEventListener(k);this.addEventListener(is_ie?"onKeyDown":"onKeyPress",this._handle_focusKeys)};g._handle_focusKeys=function(D){};g._check_accessKey=function(D){return this._accessKey&&DlKeyboard.checkKey(D,this._accessKey)};g._handle_accessKey=function(D){this.focus()};g._setFocusedStyle=function(D){this.condClass(D,this._className.peek()+"-focus")};g.focus=function(){if(this._focusable){DlEvent.focusedWidget(this);this._setFocusedStyle(true);this.callHooks("onFocus");if(!(this instanceof DlEntry)){this.scrollIntoView()}}else{if(this.parent){this.parent.focus()}}};g.blur=function(){if(this._focusable){if(!this.destroyed){this._setFocusedStyle(false);this.callHooks("onBlur")}}};g.focusInside=function(){var D=DlEvent.focusedWidget();while(D){if(D==this){break}D=D.parent}return !!D};g._createElement=function(D){var F=this._element;if(!F){var G=this.constructor,H=G.__joinedClassName||this._className.join(" ");if(!G.__joinedClassName){G.__joinedClassName=H}if(this.__addClassName){H+=" "+this.__addClassName}if(D){F=C.createFromHtml(D);F.className=H}else{F=j(this._tagName,null,{className:H})}if(this._focusable){F._dynarch_focusable=true}this._element=F}else{this.__alreadyInDom=true}F._dynarch_object=this};g.getElement=function(){return this._element};g.getParentNode=function(){return this._element.parentNode};g.getDOMChildren=function(){return Array.$(this.getContentElement().childNodes)};g.getContentElement=function(){return this.getElement()};g.setStyle=function(F,D){var H=this.getElement().style;if(arguments.length>1){H[F]=D}else{for(var G in F){this.setStyle(G,F[G])}}};g.setContent=function(F){var D=this.getContentElement();while(D.firstChild){D.removeChild(D.lastChild)}if(typeof F=="string"){D.innerHTML=F}else{if(F instanceof Function){return this.setContent(F.call(this))}else{if(F instanceof v){this.appendWidget(F,this.__appendArgs)}else{if(F instanceof Array){D.innerHTML=F.join("")}else{if(F!=null){D.appendChild(F)}}}}}return F!=null};g.ref=function(){return this.__refCnt++};g.unref=function(){return --this.__refCnt};g.refCnt=function(){return this.__refCnt};g.setContextMenu=function(D){if(this.__contextMenu instanceof v){this.__contextMenu.destroy()}if(D instanceof v){D.ref()}this.__contextMenu=D};g.setTooltip=function(D){this.__tooltip=D};g.initDOM=function(){this._setListeners();this._createElement();if(this._parent){this._parent.appendWidget(this,this.__appendArgs);this._parent=null}if(this.__disabled){this.disabled(true,true)}this.__onTooltipShow=this.__onTooltipShow.$(this);this.__onTooltipHide=this.__onTooltipHide.$(this);return this};g.setUnselectable=function(D,F){if(D==null){D=this.getElement()}C.setUnselectable(D,F)};g.disabled=function(D,F){if(D!=null&&(F||D!=this.__disabled)){this.__disabled=D;this.condClass(D,"DlWidget-disabled");this.condClass(D,this._className.peek()+"-disabled");this.applyHooks("onDisabled",[D])}return this.__disabled};g.enabled=function(D,F){if(D!=null){this.disabled(!D,F)}return !this.__disabled};g.getParent=function(G,D){if(G==null){return this.parent}var F=this;if(D){F=this.parent}while(F&&!(F instanceof G)){F=F.parent}return F};g.findParent=function(I,D){var G,H=this;if(D){H=this.parent}if(I instanceof Function){while(H&&!I(H)){H=H.parent}}else{var F=Array.$(arguments,2);while(H){G=H[I];if(G){if(G instanceof Function){if(G.apply(H,F)){break}}else{break}}H=H.parent}}return H};g.getPos=function(){return C.getPos(this.getElement())};g.getBRPos=function(){return C.getBRPos(this.getElement())};g.getOffsetPos=function(){var D=this.getElement();return{x:D.offsetLeft,y:D.offsetTop}};g.setPos=function(D,G){var F=this.getElement();if(D!=null&&typeof D=="object"){G=D.y;D=D.x}if(D!=null){F.style.left=D+"px"}if(G!=null){F.style.top=G+"px"}};g.setSize=g.setOuterSize=function(D){C.setOuterSize(this.getElement(),D.x,D.y);this.callHooks("onResize")};g.setInnerSize=function(D){C.setInnerSize(this.getContentElement(),D.x,D.y);this.callHooks("onResize")};g.getSize=g.getOuterSize=function(){return C.getOuterSize(this.getElement())};g.getInnerSize=function(){return C.getInnerSize(this.getContentElement())};g.display=function(D){var F=this.getElement().style;if(D!=null){F.display=D?"":"none";this.applyHooks("onDisplay",[D,F.display,"display"]);return D}return F.display!="none"};g.visibility=function(D){var F=this.getElement().style;if(D!=null){F.visibility=D?"":"hidden";this.applyHooks("onDisplay",[D,F.visibility,"visibility"]);return D}return F.visible!="hidden"};g.opacity=function(D){return C.setOpacity(this.getElement(),D)};g.position=function(F){var D=this.getElement().style,G=D.position;if(F!=null){D.position=F}return G};g.setIconClass=function(D){var F=this.getContentElement();m(F,D!=null,this.__withIconClass||this._className.peek()+"-withIcon");if(this.iconClass){z(F,this.iconClass)}if(D){y(F,D)}this.iconClass=D};g.addClass=function(F,D){y(this.getElement(),F,D)};g.delClass=function(D,F){z(this.getElement(),D,F)};g.condClass=function(G,F,D){m(this.getElement(),G,F,D);return G};g.zIndex=function(F){var D=this.getElement();if(F!=null){D.style.zIndex=F;return F}if(D.style.zIndex){return parseInt(D.style.zIndex,10)}return 0};g.refNode=function(D,F){this[D]=F;this.__refNodes.remove(D);if(F!=null){this.__refNodes.push(D)}return F};g.debug_highlight=function(D){this.getElement().style.backgroundColor=D||"yellow"};g.getQuickPopup=function(){var D=this.getParent(DlPopup)||0;if(D){D=D._level+1}return DlDialogPopup.get(D)};g.quickPopup=function(D){var F=this.getQuickPopup();D=Object.makeCopy(D);Object.mergeUndefined(D,{anchor:this.getElement(),align:{prefer:"CC"}});F.popup(D)};g.getScroll=function(){var D=this.getElement();return{x:D.scrollLeft,y:D.scrollTop}};g.scrollIntoView=function(){C.scrollIntoView(this.getElement())};g.flash=function(F,D){C.flash(this.getElement(),F,D)};DlEvent.atUnload(function(){do{window.DL_CLOSING=true;var H=false;for(var G in b){H=true;var D=b[G];try{b[G]=null;delete b[G];D.destroy()}catch(F){}break}}while(H);b=null})});DEFINE_CLASS("DlContainer",DlWidget,function(d,c){d.BEFORE_BASE=function(){this._widgets=[]};d.DEFAULT_ARGS={_scrollBars:["scroll",false],__noParentKeyBindings:["noParentKB",false]};c._createElement=function(){d.BASE._createElement.apply(this,arguments);if(this._scrollBars){this.setStyle("overflow","auto")}};c.appendWidget=function(g){if(g.parent){g.parent.removeWidget(g)}this._widgets.push(g);g.parent=this;if(!g.__alreadyInDom){this._appendWidgetElement.apply(this,arguments)}delete g.__alreadyInDom};c._appendWidgetElement=function(g,l){var k=g.getElement();if(typeof l=="number"){var j=this.getContentElement();try{l=j.childNodes[l];j.insertBefore(k,l)}catch(i){j.appendChild(k)}}else{if(l==null){l=this.getContentElement()}else{if(typeof l=="string"){l=document.getElementById(l)}}if(k.parentNode!==l){l.appendChild(k)}}};c.removeWidget=function(g){if(g.parent===this){this._removeWidgetElement(g);this._widgets.remove(g);g.parent=null}};c._removeWidgetElement=function(g){if(this._widgets.contains(g)){var i=g.getElement();if(i.parentNode){i.parentNode.removeChild(i)}}};c.destroyChildWidgets=function(){var g=Array.$(this._widgets);for(var j=0;j<g.length;++j){if(g[j] instanceof d){g.push.apply(g,g[j]._widgets)}}g.r_foreach(function(i){try{i.destroy()}catch(l){}});var k=this.getContentElement();if(k){k.innerHTML=""}return k};c._setListeners=function(){d.BASE._setListeners.call(this);this.addEventListener("onDestroy",this.destroyChildWidgets);this.addEventListener("onResize",this.__doLayout)};c.disabled=function(i,j){var g=d.BASE.disabled.call(this,i,j);if(i!=null){this._widgets.r_foreach(function(k){k.disabled(i,j)})}return g};c.children=function(g){return g!=null?this._widgets[g]:this._widgets};c.__doLayout=function(){var g=this.children().grep_first(function(i){return i._fillParent});if(g){g.setSize(this.getInnerSize())}};function a(i,g){i=i?Array.$(i.getElement().getElementsByTagName("*")):[];return Array.$(this.getElement().getElementsByTagName("*")).grep(g?"_dynarch_object":"_dynarch_focusable").grep(DynarchDomUtils.elementIsVisible).grep(i.contains.$(i).inverse()).map(DlWidget.getFromElement).grep("enabled").mergeSort(function(k,j){return k._tabIndex-j._tabIndex})}function f(j,l){var g=a.call(this,j);var k=g.find(j);k=g.rotateIndex(k+l);if(k!=null){return g[k]}}c.getNextFocusWidget=function(g){return f.call(this,g,1)};c.getPrevFocusWidget=function(g){return f.call(this,g,-1)};c.getFirstFocusWidget=function(){return this.getNextFocusWidget(null)};c.getLastFocusWidget=function(){return this.getPrevFocusWidget(null)};c._handleKeybinding=function(j,i){if(j.altKey||j.ctrlKey){var g=a.call(this,i,true);g.foreach(function(k){if(k._check_accessKey(j)){k._handle_accessKey(j);j.domStop=true;throw new DlExStopEventBubbling}});if(this.parent&&!this.__noParentKeyBindings){this.parent._handleKeybinding(j,this)}}};var b;d.getHiddenContainer=function(){if(!b){b=new this({className:"DlContainer-Hidden"});document.body.appendChild(b.getElement())}return b}});DEFINE_CLASS("DlRadioGroup",DlEventProxy,function(f,c){f.CONSTRUCT=function(g){if(g!=null){this._maxChecked=1;this._minChecked=null;this.id=g;this.reset();this.addEventListener("onDestroy",b)}};var d={};f.DEFAULT_EVENTS=["onChange"];f.getById=f.get=function(j){if(!j){j=Dynarch.ID("group")}var i=d[j];if(!i){i=d[j]=new this(j)}return i};function b(){if(d[this.id]){this._buttons=null;this._buttonsById=null;this._buttonsByValue=null;this._history=null;delete d[this.id]}}function a(g){if(g!=null){this._changed=true;if(g.checked()){if(this._maxChecked!=null){while(this._history.length>=this._maxChecked){var i=this._history[0];i.checked(false,true);this._history.splice(0,1)}}this._history.push(g)}else{if(this._minChecked!=null&&this._history.length<=this._minChecked){g.checked(true,true);throw new DlExStopEventProcessing()}else{this._history.remove(g)}}}}c.reset=function(){if(this._buttons){this._buttons.r_foreach(function(g){g.__group=g.__groupId=null})}this._changed=false;this._buttons=[];this._buttonsById={};this._buttonsByValue={};this._history=[];this.removeAllListeners("onChange");this.addEventListener("onChange",a)};c.changed=function(i){var g=this._changed;if(i!=null){this._changed=i}return g};c.getSelected=function(){return this._history};c.getButtons=function(){return this._buttons};c.getNextButton=function(j){if(j==null){j=this.getSelected()[0]}var i=this._buttons,g=i.nullLimitIndex(i.find(j)+1);if(g!=null){return i[g]}};c.getPrevButton=function(j){if(j==null){j=this.getSelected()[0]}var i=this._buttons,g=i.nullLimitIndex(i.find(j)-1);if(g!=null){return i[g]}};c.getValue=function(){return this._history.map("value")};c.setValue=function(l,g){var k=this._buttonsByValue;if(!(l instanceof Array)){l=[l]}l=l.toHash(true);this._history=[];for(var j in k){k[j].checked(l[j],true);if(l[j]){this._history.push(k[j])}}if(g){this.callHooks("onChange")}};c.getByValue=function(g){return this._buttonsByValue[g]};c.addWidget=function(g,j){if(!this._buttonsById[g.id]){if(j==null){j=this._buttons.length}this._buttonsById[g.id]=g;this._buttons.splice(j,0,g);if(g.checked()){this._history.push(g)}var i=g.value();if(typeof i!="undefined"){this._buttonsByValue[i]=g}g.addEventListener("onDestroy",this.removeWidget.$(this,g))}};c.removeWidget=function(g){if(this._buttonsById[g.id]){this._changed=true;delete this._buttonsById[g.id];var i=g.value();if(typeof i!="undefined"){delete this._buttonsByValue[g.value()]}this._buttons.remove(g);if(this._history.length!=this._history.remove(g).length){this.callHooks("onChange")}}};c.minChecked=function(g){if(arguments.length>0){this._minChecked=g}return this._minChecked};c.maxChecked=function(g){if(arguments.length>0){this._maxChecked=g}return this._maxChecked};c.checkAll=function(i,g){if(i==null){i=true}if(g==null){g=false}this._buttons.foreach(function(j){j.checked(i,!g)});this._history=i?Array.$(this._buttons):[]};c.unCheckAll=function(){this._history.r_foreach(function(g){g.checked(false)})}});DEFINE_CLASS("DlAbstractButton",DlWidget,function(c,b){var a=["onMouseEnter","onMouseLeave","onMouseDown","onMouseUp","onUpdateLabel","onClick","onCheck","onChange","onDisabled"];var d={STANDARD:1,TWOSTATE:2};c.DEFAULT_ARGS={_label:["label",""],_classes:["classes",{}],_checked:["checked",false],__groupId:["group",null],_btnType:["type",d.STANDARD],_value:["value",window.undefined],_noCapture:["noCapture",false],_alwaysCheck:["alwaysCheck",false]};c.CONSTRUCT=function(f){var i=this.__groupId;if(i!=null){var j;if(typeof i=="object"){j=i;this.__groupId=j.id}else{j=DlRadioGroup.get(i)}this.__group=j;j.addWidget(this,typeof f.appendArgs=="number"?f.appendArgs:null)}if(!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)}}};c.DEFAULT_EVENTS=["onCheck","onUncheck","onChange","onUpdateLabel"];b._cap_onMouseUp=function(f){var g=f.getObject();DlEvent.releaseGlobals(this._btnpressCapture);this.applyHooks("onMouseUp",[f]);if(!this._ev_mouseInside){this.applyHooks("onMouseLeave",[f])}if(g!==this){g&&g.applyHooks("onMouseEnter",[f]);DlException.stopEventBubbling()}};b._cap_onMouseEnter=function(f){var g=f.getObject();if(g===this){this.addClass(this._classes.active)}g&&(g._ev_mouseInside=true);DlException.stopEventBubbling()};b._cap_onMouseLeave=function(f){var g=f.getObject();if(g===this){this.delClass(this._classes.active)}g&&(g._ev_mouseInside=false);DlException.stopEventBubbling()};c.TYPE=d;b._onMouseEnter=function(f){this.addClass(this._classes.hover)};b._onMouseLeave=function(f){this.delClass(this._classes.hover);this.delClass(this._classes.active)};b._onMouseDown=function(f){if(f.button===0){this._ev_mouseInside=true;this.addClass(this._classes.hover);this.addClass(this._classes.active);if(!this._noCapture){DlEvent.captureGlobals(this._btnpressCapture);f.domStop=true}}};b._onMouseUp=function(f){this.delClass(this._classes.active)};b._onUpdateLabel=function(){this.condClass(!this._label||!/\S/.test(this._label),this._classes.empty)};b._onClick=function(){if(this._btnType==d.TWOSTATE){this._alwaysCheck?this.checked(true):this.toggle()}};b.keyClicked=function(f){this.addClass(this._classes.active);(function(){this.delClass(this._classes.hover);this.delClass(this._classes.active);this.applyHooks("onClick",[f])}).delayed(90,this);if(f){f.domStop=true;DlException.stopEventBubbling()}};b._handle_focusKeys=function(j){var g=j.keyCode;if(g==DlKeyboard.ENTER||j.charCode==DlKeyboard.SPACE){this.keyClicked(j)}else{if(!this._customMoveKeys&&this.__group&&g in DlKeyboard.KEYS_MOVE){var i=g in DlKeyboard.KEYS_MOVE_PREV,f=i?this.__group.getPrevButton(this):this.__group.getNextButton(this);if(f){f.focus();if(j.shiftKey){this.checked(true);f.checked(true)}j.domStop=true;DlException.stopEventBubbling()}}}c.BASE._handle_focusKeys.call(this,j)};b._handle_accessKey=function(f){this.focus();this.keyClicked(f)};b.disabled=function(f,g){if(f!=null&&f){this.delClass(this._classes.hover);this.delClass(this._classes.active)}return c.BASE.disabled.call(this,f,g)};b._onChange=function(){if(this.__group!=null){this.__group.applyHooks("onChange",[this])}};b._onCheck=Function.noop;b._onDisabled=function(f){this.condClass(f,this._classes.disabled);if(f&&this._capture){DlEvent.releaseCapture(this._capture);this._capture=null}};b._createElement=function(){c.BASE._createElement.call(this);this._createLabelElement();this.label(this._label,true);this._updateState();this.setUnselectable()};b._setListeners=function(){c.BASE._setListeners.call(this);a.r_foreach(function(f){this.addEventListener(f,this["_"+f])},this)};b._createLabelElement=Function.noop;b.label=function(f,g){if(g||arguments.length>0&&f!==this._label){this._label=f;if(f){f="<div class='DlButton-Label'>"+this._label+"</div>"}this.setContent(f);this.applyHooks("onUpdateLabel",[this._label])}return this._label};b.setLabel=b.label;b.getLabel=b.label;b.group=function(){return this.__group};b._checkTwoState=function(f){var g=this._btnType!=d.TWOSTATE;if(g&&!f){throw new DlExInvalidOperation("This operation is only available for a TWOSTATE button")}return !g};b._updateState=function(){if(this._checkTwoState(true)){var f=this._classes;this.condClass(this._checked,f.checked,f.unchecked)}};b.checked=function(g,f){this._checkTwoState();if(arguments.length>0){g=!!g;var i=!f&&(this._checked!==g);this._checked=g;this._updateState();if(i){this.callHooks("onChange");this.callHooks(g?"onCheck":"onUncheck")}}return this._checked};b.toggle=function(f){this._checkTwoState();this.checked(!this._checked,f)};b.value=function(g){var f=this._value;if(arguments.length>0){this._value=g}return f};b.setValue=b.value;b.getValue=b.value});DEFINE_CLASS("DlAnimation",DlEventProxy,function(a,f){a.DEFAULT_EVENTS=["onStart","onStop","onPause","onUpdate"];a.CONSTRUCT=function(o,p){this.addEventListener("onDestroy",this.stop.$(this));if(o!=null){this.length=o}if(p!=null){this._speed=1000/p}this._update=c.$(this)};f.start=function(p,q,o){this.stop();if(p!=null){this.length=p}if(q!=null){this._speed=1000/q}if(o!=null){if(!(o instanceof Function)){o=DlAnimation.easing[o]}this.func=o}this.t=0;this.i=0;this.callHooks("onStart");this._timer=setInterval(this._update,this._speed)};f.running=function(){return this._timer};f.stop=function(o){if(this._timer){clearInterval(this._timer);this._timer=null;this.applyHooks("onStop",[o])}};f.getPos=function(o){if(o==null){o=this.func}return o.call(this,this.t)};function c(){this.t=this.i/this.length;try{this.applyHooks("onUpdate",[this.t]);if(++this.i>this.length){this.stop(true)}}catch(o){this.stop();throw o}}var m=Math.PI,n=Math.abs,d=Math.asin,g=Math.pow,i=Math.sin,j=Math.cos,b=Math.exp,k=Math.round;var l=a.easing={elastic_b:function(o){return 1-j(-o*5.5*m)/g(2,7*o)},elastic_b_custom:function(q,p,o){q+=0.5;return 1-j(-o*q*m)/g(2,p*o)},magnetic:function(o){return 1-j(o*o*o*10.5*m)/b(4*o)},accel_b:function(o){o=1-o;return 1-o*o*o},accel_a:function(o){return o*o*o},accel_ab:function(o){o=1-o;return 1-i(o*o*o*m/2)},bounce_b:function(o){return o<1/2.75?7.5625*o*o:(o<2/2.75?(7.5625*(o-=1.5/2.75)*o+0.75):(o<2.5/2.75?(7.5625*(o-=2.25/2.75)*o+0.9375):(7.5625*(o-=2.625/2.75)*o+0.984375)))},shake:function(o){return o<0.5?-j(o*11*m)*o*o:(o=1-o,j(o*11*m)*o*o)}}});DEFINE_CLASS("DlBox",DlContainer,function(c,b,a){c.DEFAULT_ARGS={_borderSpacing:["borderSpacing",0],_align:["align",null],_tagName:["tagName","table"]};b._createElement=function(){c.BASE._createElement.call(this);var d=this.getElement();d.cellSpacing=this._borderSpacing;d.cellPadding=0;if(this._align){d.align=this._align}this.refNode("_tbody",a.createElement("tbody",null,null,d))};b.getTableElement=b.getElement;b._appendWidgetElement=function(f,d){if(d==null){this.createCellElement().appendChild(f.getElement())}else{d.appendChild(f.getElement())}};b.destroyChildWidgets=function(){var d=Array.$(this._widgets);d.r_foreach(function(f){try{f.destroy()}catch(g){}})};b.__addSep=function(f,d,i){if(!i){i=this.createCellElement()}i.separator=true;var g=this._objectType+"-"+f;if(d){g+=" "+d}i.className=g;i.innerHTML="<div class='"+g+"'>&nbsp;</div>";a.setUnselectable(i);return i};b.addSeparator=function(d,f){return this.__addSep("separator",d,f)};b.addSpace=function(d,f){return this.__addSep("spacer",d,f)}});DEFINE_CLASS("DlButton",DlAbstractButton,function(c,b,a){c.CONSTRUCT=function(){this.setIconClass(this._iconClass);this._iconClass=null};c.TYPE=DlAbstractButton.TYPE;c.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]};b._createElement=function(){c.BASE._createElement.call(this);this.addClass("DlWidget-3D")};b._createLabelElement=function(){this.getElement().innerHTML="<div class='DlButton-inner'><div></div></div>"};b.getContentElement=function(){return this.getElement().firstChild.firstChild};b.setSize=b.setOuterSize=function(d){var f=a.getPaddingAndBorder(this.getElement());if(d.x!=null){d.x-=f.x}if(d.y!=null){d.y-=f.y}f=a.getPaddingAndBorder(this.getElement().firstChild);if(d.x!=null){d.x-=f.x}if(d.y!=null){d.y-=f.y}a.setOuterSize(this.getContentElement(),d.x,d.y)}});DEFINE_CLASS("DlHbox",DlBox,function(c,b,a){var d=a.createElement;b._createElement=function(){c.BASE._createElement.call(this);this.refNode("_row",d("tr",null,null,this._tbody))};b.createCellElement=function(g){var f=d("td",null,{className:"cell"});g!=null?this._row.insertBefore(f,g):this._row.appendChild(f);return f};b._removeWidgetElement=function(f){if(this._widgets.contains(f)){var g=f.getElement();g.parentNode.parentNode.removeChild(g.parentNode)}};b.addFiller=function(){var f=this.createCellElement();f.className+=" DlHbox-filler";this.addClass("DlHbox-hasFiller")};b.setAlign=function(i,f){var g=this.getElement();switch(i){case"left":g.style.marginLeft="0";g.style.marginRight="auto";break;case"center":g.style.marginLeft="auto";g.style.marginRight="auto";break;case"right":g.style.marginLeft="auto";g.style.marginRight="0";break;default:g.style.marginLeft=i!=null?i:"auto";g.style.marginRight=f!=null?f:"auto"}};b.setEqualWidths=function(g){var f=this.children().max(function(i){return i.getSize().x});if(g){f+=g}this.children().r_foreach(function(i){i.setSize({x:f})})}});function DlPoint(a,b){if(typeof a=="object"){this.x=a.x;this.y=a.y}else{this.x=a;this.y=b}}DlPoint.prototype={clone:function(){return new DlPoint(this.x,this.y)},normalize:function(b){var a;if(this.x>b.x){a=this.x;this.x=b.x;b.x=a}if(this.y>b.y){a=this.y;this.y=b.y;b.y=a}return this},distanceTo:function(f){var d=Math.abs(f.x-this.x),c=Math.abs(f.y-this.y);return Math.sqrt(d*d+c*c)}};function DlRect(a,d,b,c){if(a instanceof DlRect){this.setFromRect(a)}else{if(typeof a=="object"){if(typeof d=="object"){if(d instanceof DlPoint){this.setFromPoints(a,d)}else{this.setFromValues(a.x,a.y,d.x,d.y)}}else{this.setFromValues(a.x,a.y,b,c)}}else{this.setFromValues(a,d,b,c)}}}DlRect.prototype={setFromRect:function(a){this.x=a.x;this.y=a.y;this.w=a.w;this.h=a.h;return this},setFromPoints:function(b,a){b=b.clone().normalize(a=a.clone());this.x=b.x;this.y=b.y;this.w=a.x-b.x+1;this.h=a.y-b.y+1;return this},setFromValues:function(a,d,b,c){this.x=a;this.y=d;this.w=b;this.h=c;return 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(a){if(a!=null){this.h=a}return this.h},width:function(a){if(a!=null){this.w=a}return this.w},containsPoint:function(a){return this.x<=a.x&&this.x+this.w>a.x&&this.y<=a.y&&this.y+this.h>a.y},intersect:function(f){var d=null,i=Math,b=i.max(this.x,f.x),a=i.max(this.y,f.y),c=i.min(this.x+this.w,f.x+f.w)-b,g=i.min(this.y+this.h,f.y+f.h)-a;if(c>0&&g>0){d=new DlRect(b,a,c,g)}return d},area:function(){return this.w*this.h},makeDiv:function(c,b){b||(b="#000");c==null&&(c=0);var a={position:"absolute",left:this.x+"px",top:this.y+"px",width:this.w-c*2+"px",height:this.h-c*2+"px",overflow:"hidden",lineHeight:"1px",fontSize:"1px",border:c+"px solid "+b};a=DynarchDomUtils.createElement("div",a,{innerHTML:"&nbsp;"});return a},positionDiv:function(a){a.style.left=this.x+"px";a.style.top=this.y+"px";a.style.height=this.h+"px";a.style.width=this.w+"px"},toString:function(){return this.w+"x"+this.h+"@"+this.x+","+this.y}};DEFINE_CLASS("DlPopup",DlContainer,function(o,g,t){var j=t.createElement,q=t.addClass,r=t.delClass,k=t.condClass;var s={};var f={};var a={};var l=/DlPopup-scroll(Up|Down)?-hover/g;o.BEFORE_BASE=function(){this._hasScrolling=false;this.visible=false};o.DEFAULT_EVENTS=["onPopup","onHide"];o.DEFAULT_ARGS={_level:["level",0],_autolink:["autolink",true],_oscroll:["scroll",{step1:5,step2:10,speed:40}],_align:["align",null],_zIndex:["zIndex",1000],_focusable:["focusable",true],_shadows:["shadows",true]};g.FINISH_OBJECT_DEF=function(){o.BASE.FINISH_OBJECT_DEF.call(this);this.constructor.get=o.get;this.constructor.clearAll=o.clearAll;s[this._objectType]=[];f[this._objectType]={}};o.get=function(C,x){var z=this.prototype._objectType;var A=false;var w=s[z].length;if(C==null||C>=w){C=w;A=true}var B=f[z];if(!f[z]){B=f[z]={}}var y=B[C];if(!y){if(!x){y=B[C]=new this({level:C})}else{y=null}}y.detachPopup();if(A&&C>0){y.attachToPopup(s[z].peek())}return y};o.clearAll=function(x){var w=s[this.prototype._objectType];w=w[x||0];if(w){w.hide()}};o.clearAllPopups=function(x){for(var w in a){if(!x||!x[w]){a[w].hide()}}};g._createElement=function(){var w=this._parent;this._parent=null;o.BASE._createElement.call(this);var x=this.getElement();this.parent=w;this.display(false);document.body.appendChild(x);if(this._shadows&&!is_ie6){x.appendChild(DlElementCache.get("SHADOWS"));q(x,typeof this._shadows=="string"?this._shadows:"ThinShadows")}else{this._shadows=false;q(x,this._objectType+"-noShadow")}if(is_gecko){x=j("div",null,{className:"Gecko-Bug-302380"},x)}this.refNode("_contentEl",j("div",null,{className:"DlPopup-scrollArea"},x));this.zIndex(this._zIndex)};g.getContentElement=function(){return this._contentEl};g.getScrollDiv=g.getContentElement;g._scrollSetArrowState=function(){var A=this.getScrollDiv(),x=this._scroll_el(0),w=this._scroll_el(1),z=A.scrollTop==0,y=A.scrollTop+A.offsetHeight==A.scrollHeight;if(z||y){this._scrollStopHandler()}k(x,z,"DlPopup-scrollUp-disabled");k(w,y,"DlPopup-scrollDown-disabled")};function u(w){this.getScrollDiv().scrollTop+=this._scrollStep*w;this._scrollSetArrowState()}function v(w,x){w._scrollStep=w._oscroll.step1;w._scrollTimer=setInterval(u.$(w,x),w._oscroll.speed);q(this,"DlPopup-scroll-hover");k(this,x>0,"DlPopup-scrollDown-hover","DlPopup-scrollUp-hover")}g._scrollStopHandler=function(){if(this._scrollTimer){clearInterval(this._scrollTimer);this._scrollTimer=null;this._scrollSetArrowState()}r(this._scroll_el(0),l);r(this._scroll_el(1),l)};g._scrollDoubleSpeed=function(w){this._scrollStep=this._oscroll[w?"step2":"step1"];return false};g._scroll_setup=function(){if(!this._hasScrolling){this._hasScrolling=true;var y=this.getElement(),x=j("div",null,{className:"DlPopup-scrollUp"},y,0),w=j("div",null,{className:"DlPopup-scrollDown"},y);x.onmouseover=v.$(null,this,-1);w.onmouseover=v.$(null,this,1);x.onmouseout=w.onmouseout=this._scrollStopHandler.$(this);x.onmousedown=w.onmousedown=this._scrollDoubleSpeed.$(this,true);x.onmouseup=w.onmouseup=this._scrollDoubleSpeed.$(this,false);this.refNode("_scrollEl0",x);this.refNode("_scrollEl1",w);this.getScrollDiv().onscroll=this._scrollSetArrowState.$(this)}this._scroll_visibile(true)};g._scroll_el=function(w){return this["_scrollEl"+w]};g._scroll_visibile=function(w){if(this._hasScrolling){if(is_gecko){this.getScrollDiv().parentNode.style.overflow=w?"auto":""}w=w?"":"none";this._scroll_el(0).style.display=w;this._scroll_el(1).style.display=w;this.args.scrollVisible=!w}};function p(){s[this._objectType][this._level]=this;if(!this._autolink||this._level==0){a[this.id]=this}}function c(){var w=s[this._objectType];var x=w[this._level+1];if(x){x.hide()}w.splice(this._level,1);if(a[this.id]){delete a[this.id]}}function m(x){if(this.args.scrollVisible){var y=this.getScrollDiv(),w=y.scrollTop;if(x.wheelDelta<0){w+=20}else{w-=20;if(w<0){w=0}}y.scrollTop=w;x.domStop=true;DlException.stopEventBubbling()}}var n=false;function i(x){var y=x.getObject();var w={};while(y&&!(y instanceof o)){if(y.currentPopup){w[y.currentPopup.id]=true}y=y.parent}if(y){while(y!=null){w[y.id]=true;y=y._parentPopup}}o.clearAllPopups(w)}g._setListeners=function(){o.BASE._setListeners.call(this);this.addEventListener({onPopup:p,onMouseWheel:m,onHide:c});if(!n){n=true;DlEvent.captureGlobal("onMouseDown",i)}};function b(w){if(w.onBeforePopup){w.onBeforePopup.call(this,w)}this._timer=null;if(!this.setContent(w.content)){return}if(w.onPopup){w.onPopup.call(this,w)}this.applyHooks("onPopup",[w]);this.showAt(w.anchor,w.align||this._align,w.pos,w.shift,w.fluid);this._prevFocus=DlEvent.focusedWidget();this.focus()}g.popup=function(w){this.args=w;this.cancel();if(!w.timeout){b.call(this,w)}else{this._timer=b.$(this,w).delayed(w.timeout)}};function d(){if(this.visible){if(this.args&&this.args.onHide){this.args.onHide.call(this,this.args)}if(this._focusable&&this._prevFocus){try{this._prevFocus.focus()}catch(w){}}this.args=null;this._timer=null;this.callHooks("onHide");this.display(false);this.visible=false}}g.hide=function(w){this.cancel();if(!w){d.call(this)}else{this._timer=d.$(this).delayed(w)}};g.cancel=function(){if(this._timer){clearTimeout(this._timer);this._timer=null}};g.correctPos=Function.noop;g.showAt=function(B,G,K,A,F){var L,z,J,y=this.getScrollDiv();if(!G){G=this._align}if(G=="mouse"){if(K==null){K=Object.makeCopy(DlEvent.latestMouseEvent.pos)}L=K;if(this._mouseDiff){L.x+=this._mouseDiff.x;L.y+=this._mouseDiff.y}G={prefer:"__",fallX1:"_R",fallX2:"_L",fallY1:"B_",fallY2:"T_"}}else{L=t.getPos(B);if(A){if(A.x){L.x+=A.x}if(A.y){L.y+=A.y}}}J=t.getOuterSize(B);z=Object.makeCopy(L);this.visibility(false);y.style.height="";this._scroll_visibile(false);this.setPos(-30000,-30000);this.display(true);if(is_ie){this.getElement().style.width=""}var w=this._bestPosition(G,z,J),C=w.height();var E=this.getScrollDiv().offsetHeight;var x=this.getElement().offsetHeight-E;z=w.getTL();if(C<E){if(F){this.children(0).setSize({y:C})}else{if(is_ie){this.getElement().style.width=y.offsetWidth+"px"}this._scroll_setup();var I=this._scroll_el(0).offsetHeight,H=this._scroll_el(1).offsetHeight;y.style.height=C-I-H-x+"px";this._scrollSetArrowState();y.scrollTop=0}}this.correctPos(z);this.setPos(z.x,z.y);if(this._parentPopup){var D=this._parentPopup.zIndex()+1;this.zIndex(D)}this.visibility(true);this.visible=true};g._bestPosition=function(E,y,G){var z=t.getWindowSize(),w=new DlRect(0,0,z.x,z.y),H=new DlPoint(y);z=this.getSize();this._doAlign(E.prefer,H,G);var C=new DlRect(H,z).intersect(w);var I=this.checkXPos(H,w);var D=this.checkYPos(H,w);if(I==0&&D==0){return C}if(I!=0){H.x=y.x;this._doAlign(E.fallX1,H,G);var F=new DlRect(H,z).intersect(w);H.x=y.x;this._doAlign(E.fallX2,H,G);var B=new DlRect(H,z).intersect(w);if(F&&B){H=F.area()>B.area()?F.getTL():B.getTL()}else{if(F){H=F.getTL()}else{if(B){H=B.getTL()}}}this.args.fallX=true}if(D!=0){H.y=y.y;this._doAlign(E.fallY1,H,G);var A=new DlRect(H,z).intersect(w);H.y=y.y;this._doAlign(E.fallY2,H,G);var x=new DlRect(H,z).intersect(w);if(A&&x){H=A.area()>x.area()?A.getTL():x.getTL()}else{if(A){H=A.getTL()}else{if(x){H=x.getTL()}}}this.args.fallY=true}return new DlRect(H,z).intersect(w)};g._doAlign=function(B,A,w){var z=this.getSize(),x=B.substr(0,1),y="";if(B.length>1){y=B.substr(1,1)}switch(x){case"T":A.y-=z.y;if(this._mouseDiff&&this.args.align=="mouse"){A.y-=2*this._mouseDiff.y}break;case"B":A.y+=w.y;if(this._mouseDiff&&this.args.align=="mouse"){A.y+=2*this._mouseDiff.y}break;case"C":case"c":A.y+=(w.y-z.y)/2;break;case"t":A.y+=w.y-z.y;break;case"b":break}switch(y){case"L":A.x-=z.x;if(this._mouseDiff&&this.args.align=="mouse"){A.x-=2*this._mouseDiff.x}break;case"R":A.x+=w.x;if(this._mouseDiff&&this.args.align=="mouse"){A.x+=2*this._mouseDiff.x}break;case"C":case"c":A.x+=(w.x-z.x)/2;break;case"l":A.x+=w.x-z.x;break;case"r":break}};g.checkXPos=function(y,x){if(y.x<x.x){return y.x-x.x}var w=this.getSize();var z=y.x+w.x-x.x-x.w;return z>0?z:0};g.checkYPos=function(y,x){if(y.y<x.y){return y.y-x.y}var w=this.getSize();var z=y.y+w.y-x.y-x.h;return z>0?z:0};g.attachToPopup=function(w){this._parentPopup=w;w._childPopup=this};g.detachPopup=function(){if(this._parentPopup){this._parentPopup._childPopup=null}this._parentPopup=null};g.getToplevelPopup=function(){var w=this;while(w._parentPopup){w=w._parentPopup}return w};g._handle_focusKeys=function(y){if(!y.altKey&&!y.ctrlKey){if(y.keyCode==DlKeyboard.ESCAPE){this.hide()}else{if(y.keyCode==DlKeyboard.TAB){var x=y.focusedWidget;x=y.shiftKey?this.getPrevFocusWidget(x):this.getNextFocusWidget(x);if(x){x.focus()}y.domStop=true;DlException.stopEventBubbling()}}}this._handleKeybinding(y)}});DEFINE_CLASS("DlVbox",DlBox,function(c,b,a){var d=a.createElement;b.createCellElement=function(){return d("td",null,{className:"cell"},d("tr",null,{className:"row"},this._tbody))};b._removeWidgetElement=function(f){if(this._widgets.contains(f)){var g=f.getElement();g.parentNode.parentNode.parentNode.removeChild(g.parentNode.parentNode)}}});function DlMenuBase(){if(this._isMenuBase){return}this._isMenuBase=true;this._items=[];var b=this;function c(f,g,d){var i=d?d.widget:null;if(!this._noClose){DlPopupMenu.clearAll()}b.applyHooks.delayed(1,b,"onSelect",[this.name,this,i])}var a=this.appendWidget;this.appendWidget=function(d){if(d instanceof DlMenuItem){this._items.push(d);if(d.name!=null){d.addEventListener("onSelect",c)}}a.apply(this,Array.$(arguments))};this.getItemByName=function(d){return this._items.grep_first(function(f){return f.name&&f.name==d})};this.getItemById=function(d){return this._items.grep_first(function(f){return f.__itemId&&f.__itemId==d})};if(this instanceof DlHMenu){this._popupAlign={prefer:"Br",fallX1:"_r",fallX2:"_l",fallY1:"B_",fallY2:"T_"}}else{this._popupAlign={prefer:"bR",fallX1:"_R",fallX2:"_L",fallY1:"b_",fallY2:"t_"}}this._getDlPopup=function(){var g=this.getParent(DlPopupMenu),d=0,f;if(g){d=g._level+1}f=DlPopupMenu.get(d);f.detachPopup();if(g){f.attachToPopup(g)}return f};this.getToplevelMenu=function(){var d=this;while(d.parentMenu){d=d.parentMenu}return d}}DEFINE_CLASS("DlPopupMenu",DlPopup,function(c,b){c.CONSTRUCT=function(){this._mouseDiff={x:2,y:1}};function a(){this.cancel();var d=this.args}c.onBeforePopup=function(d){if(!d.isContext){d.item.currentPopup=this;d.item._popupVisible=true;d.menu._popupVisible=true;d.item.activateSubmenu(true)}else{if(d.widget.activateSubmenu){d.widget.activateSubmenu(true)}}var f=d.content;if(f instanceof Function){d.content=f=f.call(this)}f.parentMenu=d.isContext?d.widget:d.menu;if(f instanceof DlWidget&&f.hasHooks("onPopup")){f.applyHooks("onPopup",[d])}};c.onHide=function(d,g){if(!d.isContext){d.item.activateSubmenu(false);d.item.currentPopup=null;d.item._popupVisible=false;d.menu._popupVisible=false;var f=d.content;if(f instanceof DlWidget&&f.hasHooks("onHide")){f.applyHooks("onHide",[d])}f.parentMenu=null}else{if(d.widget.activateSubmenu){d.widget.activateSubmenu(false)}}if(g){g.call(this,d)}};b.popup=function(d){if(!d.onBeforePopup){d.onBeforePopup=c.onBeforePopup}if(!d.onHide){d.onHide=c.onHide}else{d.onHide=c.onHide.$(this,d,d.onHide)}c.BASE.popup.call(this,d)};b._setListeners=function(){c.BASE._setListeners.call(this);this.addEventListener({onMouseEnter:a})};b.correctPos=function(j){var f=this.args;try{if(!f.isContext&&!f.scrollVisible){var d=f.menu;if(d&&(d instanceof DlVMenu)){var i=f.content._widgets[0].getPos().y-f.content.parent.getElement().offsetTop;if(Math.abs(i)<50){if(f.fallY){j.y+=i}else{j.y-=i}}}}}catch(g){}}});DEFINE_CLASS("DlHMenu",DlHbox,function(b,a){b.CONSTRUCT=DlMenuBase;b.DEFAULT_EVENTS=["onSelect","onPopup"]});DEFINE_CLASS("DlVMenu",DlVbox,function(b,a){b.CONSTRUCT=DlMenuBase;b.DEFAULT_EVENTS=["onSelect","onPopup"]});DEFINE_CLASS("DlMenuItem",DlContainer,function(j,g,d){j.CONSTRUCT=function(){if(!this.parentMenu){this.parentMenu=this.parent}};j.DEFAULT_EVENTS=["onSelect"];j.DEFAULT_ARGS={label:["label","DlMenuItem"],_iconClass:["iconClass",null],_noClose:["noClose",false],parentMenu:["menu",null],name:["name",null],__itemId:["id",null]};g._inBaseMenu=function(){return !this.parentMenu.parentMenu};g._createElement=function(){j.BASE._createElement.call(this);var k=this.getElement();k.innerHTML='<div class="div1"><div class="div2"></div></div>';this.setIconClass(this._iconClass);this._iconClass=null;this.setUnselectable();if(this.label){this.setContent(this.label)}};g.getContentElement=function(){return this.getElement().firstChild.firstChild};g._getDlPopup=function(){return this.parentMenu._getDlPopup()};function f(){this.scrollIntoView();this.addClass("DlMenuItem-hover","DlMenuItem-active");var k=this._inBaseMenu();if(!k||this.parentMenu._popupVisible){if(this._menu){this._popupMenu(k?0:250)}else{if(k){this._getDlPopup().hide(100)}}}}function a(){this.delClass("DlMenuItem-hover");this.delClass("DlMenuItem-active");var k=this._inBaseMenu();if(!k){this._getDlPopup().hide(100)}}function b(){this.delClass("DlMenuItem-active");if(this.hasHooks("onSelect")){var k=DlPopupMenu.get(0).args;if(!this._noClose){DlPopupMenu.clearAll()}this.applyHooks.delayed(1,this,"onSelect",[this.name,this,k])}}function i(){this.addClass("DlMenuItem-active");this._popupMenu(0);DlException.stopEventBubbling()}function c(){if(this._menu instanceof DlWidget){this._menu.destroy();this._menu=null}}g._popupMenu=function(l){if(this._menu&&!this._popupVisible){var k=this.parentMenu;var m=this._getDlPopup();if(m.visible){m.hide()}m.popup({timeout:l,content:this.getMenu(),anchor:this.getElement(),align:k._popupAlign,item:this,menu:this.parentMenu,onPopup:this._onPopup,onHide:this._onHide})}};g._setListeners=function(){j.BASE._setListeners.call(this);this.addEventListener({onMouseEnter:f,onMouseLeave:a,onMouseDown:i,onMouseUp:b,onDestroy:c})};g.getMenu=function(){return this._menu};g.setMenu=function(m,l,k){if(this._menu instanceof DlWidget){this._menu.destroy()}if(m instanceof DlWidget){m.ref()}this._menu=m;this._onPopup=l;this._onHide=k;d.condClass(this.getElement().firstChild,m,"DlMenuItem-withPopup")};g.activateSubmenu=function(k){this.condClass(k,"DlMenuItem-popped")}});DEFINE_CLASS("DlButtonMenu",DlHbox,function(b,a){b.CONSTRUCT=DlMenuBase;b.DEFAULT_EVENTS=["onSelect","onPopup","onHide","onClick"];b.DEFAULT_ARGS={label:["label",null],_iconClass:["iconClass",null],_shiftMenu:["shiftMenu",null],_connected:["connected",false]};a.ALIGN={prefer:"Br",fallX1:"_r",fallX2:"_l",fallY1:"B_",fallY2:"T_"};a.activateSubmenu=function(c){this._mainBtn.condClass(c,"DlButton-1");this._menuBtn.condClass(c,"DlButton-1")};a._createElement=function(){b.BASE._createElement.call(this);this._mainBtn=new DlButton({parent:this,focusable:false,label:this.label,className:"LabelPart",noCapture:this._connected,iconClass:this._iconClass});this._mainBtn.connectEvents("onClick",this);this._menuBtn=new DlButton({parent:this,focusable:false,label:"&nbsp;",className:"MenuArrow",noCapture:true});this._menuBtn.getElement().parentNode.style.width="3px";this._menuBtn.getContentElement().className="MenuArrow-inner";if(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))};a._do_popupMenu=function(c){if(!this._popupVisible){var d=this._getContextMenuPopup();d.popup({timeout:0,content:this.getMenu(),align:this.ALIGN,anchor:this.getTableElement(),isContext:true,widget:this,shift:this._shiftMenu,onHide:this.callHooks.$(this,"onHide")});if(c instanceof DlEvent){c._justFocusedWidget=d}this.callHooks("onPopup")}};a.getMenu=function(){return this._menu};a.getButton=function(){return this._mainBtn};a.getArrow=function(){return this._menuBtn};a.setMenu=function(c){if(this._menu instanceof DlWidget){this._menu.destroy()}if(c instanceof DlWidget){c.ref()}this._menu=c}});var DlElementCache={get:function(a){return this[a].cloneNode(true)}};(function(){eval(DynarchDomUtils.importCommonVars());var C=DlElementCache;(function(){var TBODY_RC=document.createDocumentFragment();CE("td",null,null,CE("tr",null,null,CE("tbody",null,null,TBODY_RC)));C.TBODY_RC=TBODY_RC})();(function(){var SHADOWS=document.createDocumentFragment();CE("div",null,{className:"Shadow Shadow-TL"},SHADOWS);CE("div",null,{className:"Shadow Shadow-T"},SHADOWS);CE("div",null,{className:"Shadow Shadow-TR"},SHADOWS);CE("div",null,{className:"Shadow Shadow-L"},SHADOWS);CE("div",null,{className:"Shadow Shadow-R"},SHADOWS);CE("div",null,{className:"Shadow Shadow-BL"},SHADOWS);CE("div",null,{className:"Shadow Shadow-B"},SHADOWS);CE("div",null,{className:"Shadow Shadow-BR"},SHADOWS);C.SHADOWS=SHADOWS})();(function(){var STATIC_ROW=CE("tr");var STATIC_CELL=CE("td",null,null,STATIC_ROW);(6).times(function(){STATIC_ROW.appendChild(STATIC_CELL.cloneNode(true))});C.CAL_HEAD=CE("thead");C.CAL_HEAD.appendChild(STATIC_ROW.cloneNode(true));var STATIC_BODY=C.CAL_BODY=CE("tbody");(6).times(function(){STATIC_BODY.appendChild(STATIC_ROW.cloneNode(true))})})();C.DRAGGING_LINE=CE("div",null,{className:"DlResizeBar-DraggingLine"});DlEvent.atUnload(function(){var trash=DynarchDomUtils.trash();for(var i in C){var el=C[i];if(!(el instanceof Function)){trash.appendChild(C[i]);delete C[i];el=C[i]=null}}C=DynarchDomUtils.CE_CACHE;for(var i in C){var el=C[i];if(el!==trash){trash.appendChild(C[i]);delete C[i];el=C[i]=null}}trash.innerHTML="";if(is_ie){trash.outerHTML=""}delete DynarchDomUtils.CE_CACHE._trash;DynarchDomUtils.CE_CACHE._trash=null;C=null})})();DEFINE_CLASS("DlCalendar",DlWidget,function(a,j,o){var l=o.createElement,g=o.addClass,f=o.delClass,n=o.condClass;a.FIXARGS=function(p){p.tagName="table";this._dayNamesOn=-1;this._selectedDate=p.date&&p.selected?p.date.getDate():0};a.CONSTRUCT=function(){if(!this._noinit){this.init()}};a.DEFAULT_EVENTS=["onSelect","onChange","onRendered"];a.DEFAULT_ARGS={firstDay:["firstDay",Date.getFirstDayOfWeek()],fixedFirstDay:["fixedFirstDay",true],_weekNumbers:["weekNumbers",false],date:["date",null],selected:["selected",true],_navigation:["navigation",2],_navDisabled:["navDisabled",false],_omDisabled:["omDisabled",false],_noinit:["noinit",false],_withMenu:["withMenu",false],_disableHandler:["disableHandler",Function.returnFalse],_cal_tooltip:["dayTooltip",null],_infoDates:["infoDates",null],__tooltip:["tooltip",k]};j._createElement=function(){a.BASE._createElement.call(this);var w,u,x,s,y=this.getElement(),v=DlElementCache.get("CAL_BODY");y.cellSpacing=y.cellPadding=y.border=0;y.appendChild(DlElementCache.get("CAL_HEAD"));y.appendChild(v);if(this._weekNumbers){w=y.getElementsByTagName("tr");for(u=w.length;--u>=0;){x=w[u];s=l("td",null,{className:"DlCalendar-WeekNumber"});x.insertBefore(s,x.firstChild)}}x=l("tr");s=l("td",null,null,x);x.className="DlCalendar-Navigation";if(this._navigation==0){s.colSpan=this.getNCols();this._makeNavPart(s,0)}else{var t=l("td",null,null,x);var r=l("td",null,null,x);if(this._navigation==1){t.colSpan=this.getNCols()-2;this._makeNavPart(t,0,s,-1,r,1)}else{if(this._navigation==2){var q=l("td",null,null,x);var p=l("td",null,null,x);r.colSpan=this.getNCols()-4;this._makeNavPart(r,0,s,-2,t,-1,q,1,p,2)}}}u=y.rows[0];u.parentNode.insertBefore(x,u);this.setUnselectable();if(this._withMenu){this._createQuickNavMenu()}};var b=null;function c(){if(!b){b=new DlVMenu({});b.setStyle("textAlign","center");new DlMenuItem({parent:b,label:DlTEXTS.goToday,name:"today",noClose:true});b.addSeparator();var p=new DlSpinner({parent:b,size:4});p.addEventListener("onChange",function(){if(!p.validationError){b.calendar.setYear(p.getValue())}});p.getElement().align="center";b.addSeparator();(12).times(function(q){new DlMenuItem({parent:b,label:Date.getMonthName(q),name:q,noClose:true})});b.addEventListener("onPopup",function(q){this.calendar=q.widget;p.setValue(this.calendar.date.getFullYear());p.focus.$(p).delayed(5)});b.addEventListener("onSelect",function(q){if(q=="today"){this.calendar.setToday()}else{this.calendar.setMonth(q);this.calendar.setYear(p.getValue())}b.getParent(DlPopup).hide()})}return b}j._createQuickNavMenu=function(){this.setContextMenu(c)};j._makeNavPart=function(){var r,q,p;for(var p=0;p<arguments.length;++p){r=arguments[p++];q=arguments[p];r._navType=q;switch(q){case -2:r.className="PrevYear";break;case -1:r.className="PrevMonth";break;case 0:r.className="Month";this.refNode("_monthTD",r);break;case 1:r.className="NextMonth";break;case 2:r.className="NextYear";break}}};j.getNCols=function(){return this._weekNumbers?8:7};j.getTableElement=function(){return this.getElement()};j._displayDayNames=function(){var u,p=new Date(),t=p.getDay(),s=this.getTableElement().getElementsByTagName("tr")[1],r=this._weekNumbers?1:0,q=this.firstDay;s.className="DlCalendar-DayNames";while(u=s.cells[r++]){u._firstDay=q%7;n(u,q==t,"Today");u.innerHTML=Date.getDayName(q++,true);n(u,Date.isWeekend(u._firstDay),"WeekEnd")}this._dayNamesOn=this.firstDay;if(this._weekNumbers){u=s.cells[0];u.innerHTML="w";u._week=-1;u.className="WeekNumber"}};j._displayCalendar=function(){var E=new Date(),z=E.getFullYear(),I=E.getMonth(),q=E.getDate();this._selectedTD=null;if(this._dayNamesOn!=this.firstDay){this._displayDayNames()}var G=new Date(this.date);G.setHours(12);var H=G.getMonth();var K=G.getDate();var w=G.getFullYear();var J=G.getMonthDays();this._monthTD.innerHTML=String.buffer("<b>",Date.getMonthName(H,this._navigation==2),"</b> ",w).get();G.setDate(1);var A=(G.getDay()-this.firstDay)%7;if(A<0){A+=7}G.setDate(-A);G.setDate(G.getDate()+1);var s=this.getTableElement().rows[2];var r=this._cells=[];var D=this._displayedInterval={};var F;for(var C=0;C<6;++C,s=s.nextSibling){s.className="Dates";var p=s.firstChild;if(this._weekNumbers){p.className="WeekNumber";p.innerHTML=p._week=G.getWeekNumber();p=p.nextSibling}var u;for(var B=0;B<7;++B,p=p.nextSibling,G.setDate(u+1)){var v=G.getDay();var t=[];p._iday=u=G.getDate();p._month=G.getMonth();p._year=G.getFullYear();p._info=null;F={y:p._year,m:p._month,d:p._iday};if(this._infoDates){var y=F.y+"-"+(1+F.m).zeroPad(2)+"-"+F.d.zeroPad(2);var x=this._infoDates[y];if(x){p._info=x;t.push(x.className||"DlCalendar-infoDay")}}if(!D.start){D.start=F}if((p._otherMonth=(H!=F.m))){t.push("OtherMonth");r[u+(u>15?100:200)]=p}else{if(H==I&&u==q&&z==F.y){t.push("Today")}if(this._selectedDate==u){this._selectCell(p);t.push("Selected")}r[u]=p}if(v==0||v==6){t.push("WeekEnd")}p.disabled=this._disableHandler(G,t,p);p.innerHTML=this.getDayHTML(u);p.className=t.join(" ")}}D.end=F;this.applyHooks("onRendered",[this])};j.getDayHTML=Function.identity;j.getDateCell=function(p){return this._cells[p]};j.getDisplayedInterval=function(){return this._displayedInterval};j.selectDate=function(q,p){if(q instanceof Date){if(!q.dateEqualsTo(this.date,true)){this.date=new Date(q);this.init()}q=q.getDate()}this._selectCell(this.getDateCell(q),!p)};function i(q){this._clearTimer();var p=q.getParentElement("td",this);if(p){if(this._currentHover){f(this._currentHover,"hover");f(this._currentHover,"rolling");this._currentHover=null;DlWidget.getTooltip().hide()}if(p._navType!=null&&this._navDisabled){return}if(p._otherMonth&&this._omDisabled){return}if((p._firstDay!=null&&this.fixedFirstDay)||p._week!=null){return}if(p.disabled){return}g(p,"hover");this._currentHover=p;if(this.__tooltip){this._popupTooltip()}}}function d(p){this._clearTimer();if(this._currentHover){f(this._currentHover,"hover");f(this._currentHover,"rolling");this._currentHover=null}}j.setYear=function(p){if(p!=this.date.getFullYear()){this.date.setFullYear(p);this.init()}};j.setMonth=function(p){if(p!=this.date.getMonth()){this.date.setMonth(p);this.init()}};j.setToday=function(){var p=new Date();this._selectedDate=0;this.date=p;this.init()};j._navCellClicked=function(p,s,r){g(p,"rolling");this._selectedDate=0;var t=this.date;if(p._navType!=0){t.setDate(1)}switch(p._navType){case 0:if(this._withMenu){this.applyHooks("onContextMenu",[r])}else{var q=new Date();if(t.dateEqualsTo(q,true)){return}this.date=q}break;case -2:t.setFullYear(t.getFullYear()-1);break;case -1:t.setMonth(t.getMonth()-1);break;case 1:t.setMonth(t.getMonth()+1);break;case 2:t.setFullYear(t.getFullYear()+1);break}this.init();this.applyHooks("onChange",[p._navType]);this.applyHooks("onSelect",[true,p._navType,null,t]);if(s&&p._navType!=0){++this._timerStep;this._timer=setTimeout(this._navCellClicked.$(this,p,this._timerStep>4?50:100),s)}};j._clearTimer=function(){if(this._timer){clearTimeout(this._timer)}this._timer=null;this._timerStep=0};function m(r){i.call(this,r);var p=r.getParentElement("td",this);if(!p){return}if(r.button!=0&&(p._navType!=null||p._otherMonth)){return}if(p._otherMonth&&this._omDisabled||p.disabled){return}if(p._navType!=null&&r.dl_type=="onMouseDown"){this._navDisabled||this._navCellClicked(p,p._navType!=0?350:0,r)}else{if(p._year!=null&&r.dl_type=="onMouseUp"){var s=this.date;s.setDate(p._iday);s.setMonth(p._month);s.setFullYear(p._year);var q=this._selectedDate;this._selectedDate=p._iday;if(p._otherMonth){this.init();this.applyHooks("onSelect",[false,true,false,s])}else{if(q!=this._selectedDate){this._selectCell(p,true)}else{this.applyHooks("onSelect",[false,false,true,s])}}}else{if(p._firstDay!=null&&!this.fixedFirstDay&&r.button==0&&r.dl_type=="onMouseDown"){this.firstDay=p._firstDay;this._displayCalendar()}}}}j._selectCell=function(q,p){this._selectedDate=q._iday;if(this._selectedTD){f(this._selectedTD,"Selected");f(this._selectedTD.parentNode,"Selected")}this._selectedTD=q;g(q,"Selected");g(q.parentNode,"Selected");f(q,"hover");if(p){this.applyHooks("onSelect",[false,false,false,this.date])}};j._setListeners=function(){a.BASE._setListeners.call(this);this.addEventListener({onMouseOver:i,onMouseLeave:d,onMouseUp:m,onMouseDown:m})};j.setInfoDates=function(p){this._infoDates=p;if(this._initialized){this._displayCalendar()}};function k(){var q=this.args.widget,p,r;r=q._currentHover;if(r){p=r._info}r=q._cal_tooltip;return r?r.call(q,p):p?p.tooltip:null}j.init=function(){if(!this.date){this.date=new Date()}this._displayCalendar();this._initialized=true}});DEFINE_CLASS("DlButtonCalendar",DlButtonMenu,function(c,b){c.DEFAULT_ARGS={dateFormat:["dateFormat","%Y/%m/%d"],_calendarArgs:["calendar",{}],_iconClass:["iconClass","IconCalendar"],date:["date","Select date..."]};c.DEFAULT_EVENTS=["onSelect","onCalendarRendered"];function a(i,f,g){if(!f){this.getButton().setContent(i.date.print(this.dateFormat));DlPopup.clearAllPopups();this.date=new Date(i.date);this.applyHooks("onSelect",[this.date])}}function d(f){if(this.date instanceof Date){var g=this.getCalendar();if(!g.date.dateEqualsTo(this.date)){g.date=new Date(this.date);g._selectedDate=this.date.getDate();g.init()}}this.getArrow().applyHooks("onMouseDown",[f])}b.getCalendar=function(){var f=this._calendar;if(!f){this._calendarArgs.noinit=true;f=this._calendar=new DlCalendar(this._calendarArgs);this.addEventListener("onDestroy",f.destroy.$(f));f.addEventListener("onSelect",a.$(this,f));f.connectEvents("onRendered",this,"onCalendarRendered");if(this.date instanceof Date){f.date=new Date(this.date)}f.init()}return this._calendar};b.initDOM=function(){c.BASE.initDOM.call(this);var f=this.getButton();if(this.date instanceof Date){f.label(this.date.print(this.dateFormat))}else{f.label(this.date)}this.setMenu(this.getCalendar.$(this));f.addEventListener("onClick",d.$(this))};b.getValue=function(){return this.date instanceof Date?this.date:null}});DEFINE_CLASS("DlButtonColorPicker",DlButtonMenu,function(a,f,k){a.CONSTRUCT=function(){this._events_cp={onSelect:g.$(null,this),onHueChange:b.$(null,this),onHover:d.$(null,this),onHoverOut:i.$(null,this)};this._updateValues()};a.DEFAULT_ARGS={rgb:["rgb",null],hsv:["hsv",null],color:["color",null]};function g(o,n,m,l,p){var q=o.getColorElement();q.style.backgroundColor=l;o.hsv=Array.$(m);o._updateValues();DlPopup.clearAllPopups();o.applyHooks("onSelect",[n,m,l,p])}function d(o,n,m,l,p){o.getColorElement().style.backgroundColor=l}function b(o,m){if(o.hsv){var n=[m,o.hsv[1],o.hsv[2]];var l=DlColor.RGB2color(DlColor.HSV2RGB(n));o.getColorElement().style.backgroundColor=l;o.hsv=n;o._updateValues()}}function i(l){var m=l.getColorElement();m.style.backgroundColor=l.rgb?DlColor.RGB2color(l.rgb):""}f._updateValues=function(){if(this.hsv){this.rgb=DlColor.HSV2RGB(this.hsv);this.color=DlColor.RGB2color(this.rgb)}else{if(this.rgb){this.hsv=DlColor.RGB2HSV(this.rgb);this.color=DlColor.RGB2color(this.rgb)}else{if(this.color){this.rgb=DlColor.color2RGB(this.color);this.hsv=DlColor.RGB2HSV(this.rgb)}}}};function j(){this._cp.addEventListener(this._events_cp);if(this.hsv){this._cp.setHSV(this.hsv)}}function c(){this._cp.removeEventListener(this._events_cp)}f.setColorPicker=function(l){this._cp=l;this.setMenu(l);if(this.hsv){l.setHSV(this.hsv);g.call(l,this,this.rgb,this.hsv,DlColor.RGB2color(this.rgb),DlColor.RGBrightness(this.rgb))}};f._createElement=function(){a.BASE._createElement.call(this);var l=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)};f.setLabel=function(l){var m=this.getLabelElement();m.innerHTML=l||"";k.condClass(m,l,"Label","EmptyLabel")};f.getColorElement=function(){return this.getButton().getContentElement().firstChild.rows[0].cells[0].firstChild};f.getLabelElement=function(){return this.getButton().getContentElement().firstChild.rows[0].cells[1]};f._setListeners=function(){a.BASE._setListeners.call(this);this.addEventListener({onPopup:j,onHide:c})}});DEFINE_CLASS("DlCheckbox",DlAbstractButton,function(b,a){b.DEFAULT_ARGS={_classes:["classes",{active:"DlCheckbox-active",hover:"DlCheckbox-hover",checked:"DlCheckbox-1",unchecked:"DlCheckbox-0",empty:"DlCheckbox-empty",disabled:"DlCheckbox-disabled"}]};b.FIXARGS=function(c){c.type=DlButton.TYPE.TWOSTATE}});var DlColor={RGB2HSV:function(i){var a=i[0],f=i[1],j=i[2];var c,k,m,d,n,l;c=Math.min(a,f,j);k=Math.max(a,f,j);l=k;m=k-c;if(k!=0){n=m/k;if(a==k){d=(f-j)/m}else{if(f==k){d=2+(j-a)/m}else{d=4+(a-f)/m}}d*=60;if(d<0){d+=360}}else{n=0;d=-1}return[d,n,l]},HSV2RGB:function(l){var k=l[0],x=l[1],u=l[2];var j,a,m,o,n,d,c,w;if(x==0){a=m=o=u}else{k/=60;j=Math.floor(k);n=k-j;d=u*(1-x);c=u*(1-x*n);w=u*(1-x*(1-n));switch(j){case 0:a=u;m=w;o=d;break;case 1:a=c;m=u;o=d;break;case 2:a=d;m=u;o=w;break;case 3:a=d;m=c;o=u;break;case 4:a=w;m=d;o=u;break;default:a=u;m=d;o=c;break}}return[a,m,o]},RGB2bytes:function(c){var a=new Array(3);a[0]=Math.round(c[0]*255);a[1]=Math.round(c[1]*255);a[2]=Math.round(c[2]*255);return a},RGB2color:function(a){return String.buffer("rgb(",a[0]*100,"%,",a[1]*100,"%,",a[2]*100,"%)").get()},RGB2hex:function(a){a=DlColor.RGB2bytes(a);return a[0].hex(2)+a[1].hex(2)+a[2].hex(2)},color2RGB:function(c){var f=0,d=0,a=0;if(/^#/.test(c)){if(c.length==4){c=c.replace(/([a-f0-9])/ig,"$1$1")}f=parseInt(c.substr(1,2),16)/255;d=parseInt(c.substr(3,2),16)/255;a=parseInt(c.substr(5,2),16)/255}else{throw new DlException("Can't parse color: "+c)}return[f,d,a]},brighter:function(c){var b=Array.$(c);b[1]-=0.5;if(b[1]<0){b[1]=0}return b},darker:function(c){var b=Array.$(c);b[2]-=0.5;if(b[2]<0){b[2]=0}return b},RGBrightness:function(a){return(a[0]*299+a[1]*587+a[2]*114)/1000}};DEFINE_CLASS("DlColorPickerHSV",DlWidget,function(a,i,o){var f=o.delClass,m=o.condClass;a.DEFAULT_EVENTS=["onSelect","onHover","onHoverOut","onHueChange"];var d=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();i.getHueBarElement=function(){return this.getElement().rows[0].cells[12].firstChild};i._createElement=function(){a.BASE._createElement.call(this,d);this.setUnselectable()};function k(r){var q=r.target;try{while(q&&q.tagName.toLowerCase()!="td"){q=q.parentNode}}catch(p){q=null}return q}function j(p){var q=k(p);if(!q){return}if(q.rgb){this.applyHooks("onSelect",[q.rgb,q.hsv,q.style.backgroundColor,DlColor.RGBrightness(q.rgb)])}throw new DlExStopEventBubbling}function l(p){var r=k(p);if(!r){return}var q=r.getAttribute("hueCell");if(q){p.computePos(this);this._refresh(p);DlEvent.captureGlobals(this._dragHandlers)}throw new DlExStopEventBubbling}function g(q){if(this._currentHover){f(this._currentHover,"hover1");f(this._currentHover,"hover2")}var r=k(q);if(r){if(r.rgb){this._currentHover=r;var p=DlColor.RGBrightness(r.rgb);m(r,p>0.6,"hover2","hover1");this.applyHooks("onHover",[r.rgb,r.hsv,r.style.backgroundColor,p])}else{if(this._currentHover){this.callHooks("onHoverOut");this._currentHover=null}}}}function b(){var p=this._currentHover;if(p){f(p,"hover1");f(p,"hover2");this.callHooks("onHoverOut")}this._currentHover=null}function c(p){DlEvent.releaseGlobals(this._dragHandlers);throw new DlExStopEventBubbling}function n(p){var r=p.computePos(this);var q=r.y-2;if(q<0){q=0}else{if(q>119){q=119}}this.getHueBarElement().style.top=q+"px";if(this.__cphsvTimeout){clearTimeout(this.__cphsvTimeout)}this.__cphsvTimeout=this._refresh.$(this,p).delayed(5);throw new DlExStopEventBubbling}i.initDOM=function(){a.BASE.initDOM.call(this);this.addEventListener({onMouseUp:j,onMouseDown:l,onMouseOver:g,onMouseLeave:b});this._dragHandlers={onMouseMove:n.$(this),onMouseUp:c.$(this),onMouseOver:DlException.stopEventBubbling,onMouseOut:DlException.stopEventBubbling,onMouseEnter:DlException.stopEventBubbling,onMouseLeave:DlException.stopEventBubbling};this._redraw(360)};i._refresh=function(q){var r=Math.limit(q.relPos.y-2,0,119);var p=Math.round((1-r/120)*360);p=this._redraw(p);this.applyHooks("onHueChange",[p]);this.__cphsvTimeout=null};i.setHSV=function(p){this._redraw(p[0])};i._redraw=function(s){var r,v,q,x,p=this.getHueBarElement(),w=this.getElement(),y=w.rows,u=y.length-1,t=y[0].cells.length-3;p.style.top=(120-s/3)+"px";if(s==360){s=0}for(r=u;r>=0;--r){x=y[r].cells;for(q=t;q>=0;--q){v=x[q];v.hsv=[s,1-r/u,q/t];v.rgb=DlColor.HSV2RGB(v.hsv);v.style.backgroundColor=DlColor.RGB2color(v.rgb)}}return s}});DEFINE_CLASS("DlEntry",DlContainer,function(a,c,l){var g=l.createElement;a.FIXARGS=function(m){m.tagName="table";this._isTextArea=m.type=="textarea"};a.DEFAULT_EVENTS=["onChange","onKey-ENTER","onKey-ESCAPE","onValidationError","onValidation"];a.DEFAULT_ARGS={_domType:["type","text"],_value:["value",null],_size:["size",null],_rows:["rows",null],_readonly:["readonly",false],_emptyText:["emptyText",""],_width:["width",null],_name:["name",null],_validators:["validators",[]],_allowEmpty:["allowEmpty",null],_focusable:["focusable",2],_maxlen:["maxlength",null],_noSelect:["noSelect",false],_noWrap:["noWrap",false]};c.validate=function(q){if(q==null){q=this.getValue()}if(this._allowEmpty!=null){if(!/\S/.test(q)){this.condClass(!this._allowEmpty,"DlEntry-ValidationError");this.applyHooks("onValidation",[!this._allowEmpty]);return this._allowEmpty}}var m=this._validators,o,n,p=false;for(o=0;o<m.length;++o){n=m[o];if(!n.ok(q)){p=n.getError()||true;break}}if(n&&!p){this.setValue(n.getLastVal(),true)}this.validationError=p;if(!this._noSelect&&this._focused&&!this.readonly()&&this._domType!="textarea"){this.select()}this.condClass(p,"DlEntry-ValidationError");this.applyHooks("onValidation",[p]);if(p){this.applyHooks("onValidationError",[p])}return !p};c.timerFocus=function(m){return this.focus.clearingTimeout(m||10,this)};c.select=function(){try{if(is_gecko){this.setSelectionRange(0,this.getValue().length)}else{this.getInputElement().select()}}catch(m){}};c.focus=function(){this.getInputElement().focus();if(!this._noSelect&&!this.readonly()&&this._domType!="textarea"){this.select()}};c.blur=function(){this.getInputElement().blur()};function d(){this.addClass("DlEntry-Focus");this._focused=true;a.BASE.focus.call(this);if(this._isEmpty){this.getInputElement().value="";this.delClass("DlEntry-empty");this._isEmpty=false}}function j(){this.delClass("DlEntry-Focus");this._focused=false;a.BASE.blur.call(this);this.__setEmpty()}function b(){this.__setEmpty();this.callHooks("onChange")}c.__setEmpty=function(m){if(m==null){m=this.getInputElement().value}this._isEmpty=this.__checkEmpty(m);if(!this._isEmpty){this.delClass("DlEntry-empty")}else{if(!this._focused){this.addClass("DlEntry-empty");this.getInputElement().value="";(function(){if(!this.destroyed&&!this._focused&&this.__checkEmpty()){this.getInputElement().value=this._emptyText}}).delayed(0,this)}else{this.getInputElement().value=m}}return this._isEmpty};c.__checkEmpty=function(m){if(m==null){m=this.getInputElement().value}return m===""};c._createElement=function(){a.BASE._createElement.apply(this,arguments);var n=this.getElement();n.appendChild(DlElementCache.get("TBODY_RC"));n.cellSpacing=n.cellPadding=n.border=0;n=n.rows[0].cells[0];n.className="DlEntry-cell";var m=this._isTextArea?document.createElement("textarea"):m=document.createElement("input");m.setAttribute("autocomplete","off",1);if(this._noWrap){m.setAttribute("wrap","off")}if(this._isTextArea){if(this._rows){m.rows=this._rows}}if(this._maxlen!=null){m.setAttribute("maxlength",this._maxlen)}switch(this._domType){case"password":case"file":case"hidden":m.type=this._domType}if(is_gecko&&gecko_version<1.9&&!this._no_gecko_bug){n=g("div",null,{className:"Gecko-Bug-226933"},n)}n.appendChild(m)};c.getInputElement=function(){return this.getElement().getElementsByTagName(this._isTextArea?"textarea":"input")[0]};c.getContentElement=c.getInputElement;c.setIfEmpty=function(n,m){if(this._isEmpty&&n){this.setValue(n,m)}};c.isEmpty=function(){return this.__checkEmpty()};c.setValue=function(n,m){if(!this.__setEmpty(n)){if(this._maxlen!=null){n=String(n).substr(0,this._maxlen)}this.getInputElement().value=n}if(!m){this.callHooks("onChange")}};c.clear=function(m){this.setValue("",m);return this};c.getValue=function(){return this._isEmpty?"":this.getInputElement().value};c.getSelectionRange=function(){return l.getSelectionRange(this.getInputElement())};c.setSelectionRange=function(n,m){l.setSelectionRange(this.getInputElement(),n,m)};c.moveEOF=function(){var m=this.getValue().length;this.setSelectionRange(m,m)};c.moveBOF=function(){this.setSelectionRange(0,0)};c.collapse=function(m){var n=this.getSelectionRange();n=m?n.start:n.end;this.setSelectionRange(n,n)};function f(){this.validate()}function k(m){this._isEmpty=false;if(m.keyCode==DlKeyboard.ENTER){this.applyHooks("onKey-ENTER",[m])}else{if(m.keyCode==DlKeyboard.ESCAPE){this.applyHooks("onKey-ESCAPE",[m])}}}function i(){l.removeEvent(this.getInputElement(),{focus:this._on_element_focus,blur:this._on_element_blur,change:this._on_element_change})}c.initDOM=function(){a.BASE.initDOM.call(this);var m=this.getInputElement();l.addEvent(m,{focus:this._on_element_focus=d.$(this),blur:this._on_element_blur=j.$(this),change:this._on_element_change=b.$(this)});this.addEventListener({onChange:f,onKeyPress:k,onDestroy:i});if(this._value!=null){this.setValue(this._value,true)}else{this.clear(true)}if(this._width!=null){m.style.width=this._width}else{if(this._size!=null){this.setSize({x:this._size*9+7-this._size})}}if(this._name!=null){m.name=this._name}this.readonly(this._readonly)};c.readonly=function(n){var m=this.getInputElement();if(n!=null){m.readOnly=n;n?m.setAttribute("readonly",true,1):m.removeAttribute("readonly");this.condClass(n,"DlEntry-Readonly")}return m.getAttribute("readonly")};c.disabled=function(n,o){var m=a.BASE.disabled.call(this,n,o);if(n!=null){this.getInputElement().disabled=!!n}return m};c.setSize=c.setOuterSize=function(q){var p=this.getInputElement(),m=q.x,s=q.y,o=l.getPaddingAndBorder(this.getElement()),n=l.getPaddingAndBorder(p),r=this._btn?this._btn.getSize().x:0;if(r){l.setOuterSize(p,q.x-o.x-n.x-r+2)}else{if(m!=null){m-=n.x+4}if(s!=null){s-=n.y+4}if(this._domType!="textarea"){s=null}l.setInnerSize(p,m,s);if(m!=null){m+=8;l.setInnerSize(this.getElement(),m)}}};c._makeButton=function(n,m,p,o){if(!o&&!p){p="DlEntry-dropDownBtn";o={hover:"DlEntry-dropDownBtn-hover",active:"DlEntry-dropDownBtn-active"}}var q=g("td",null,null,this.getElement().rows[0]);return this._btn=new DlAbstractButton({parent:this,appendArgs:q,label:n,iconClass:m,className:p,classes:o})}});DEFINE_CLASS("DlCompletionEntry",DlEntry,function(a,j,q){a.DEFAULT_EVENTS=["onCompletion","onSelect"];a.DEFAULT_ARGS={__timeout:["timeout",500],_shiftMenu:["shift",null],__smart:["smart",true],__noTab:["noTab",false],_noSelect:["noSelect",true],_sizeToFit:["sizeToFit",false],_electric:["electric",true]};j.ALIGN={prefer:"Br",fallX1:"_r",fallX2:"_L",fallY1:"B_",fallY2:"T_"};j._setListeners=function(){this.__on_itemHover=k.$(null,this);this.__on_itemSelect=o.$(null,this);a.BASE._setListeners.call(this);this.addEventListener({onKeyDown:l,onBlur:b,onDestroy:this.__clearTimer})};j._hideMenu=function(){m().hide(50);this.__clearTimer()};j.__clearTimer=function(){if(this.__timer){clearTimeout(this.__timer)}this.__timer=null};var n=null;function m(){if(!n){n=DlCompletionPopup.get()}return n}var c=null;var p=null;function g(){if(c){p=null;c.destroy()}return c=new DlVMenu({})}function i(){return c&&c.parent.visible}function k(t,r){var s=c.children().find(this);if(s!=p&&p!=null){c.children(p).callHooks("onMouseLeave")}p=s;if(t._electric||!r){t._applyCompletion(this.userData)}}function o(r){r._hideMenu();r._applyCompletion(this.userData,true);r.applyHooks("onSelect",[this.userData]);r.focus.delayed(0,r)}j._applyCompletion=function(x,s){if(!x.nomodify||s){var t=this.getSelectionRange();var v=x.completion||x.label;if(s&&x.after){v+=x.after}var u=this.getValue();var w=x.start!=null?x.start:t.start;u=u.substr(0,w)+v+u.substr(t.end);this.setValue(u);t.end=w+v.length;if(x.rstart!=null){t.start=x.rstart}if(x.noselect||s){t.start=t.end}this.setSelectionRange(t)}};j._on_menuHide=function(){if(c){c.destroy();c=null;p=null}};j.completionReady=function(t){if(this.__timer||this.__forced){if(t!=null&&t.length>0){if(this.__smart&&t.length==1){this._applyCompletion(t[0],true);this.applyHooks("onSelect",[t[0]])}else{var s=g();var u=null;t.foreach(function(x){var v=new DlMenuItem({parent:s,label:x.label,data:x});v.addEventListener({onSelect:this.__on_itemSelect,onMouseEnter:this.__on_itemHover});if(x.selected){u=v}},this);m().popup({timeout:0,content:s,align:this.ALIGN,anchor:this.getElement(),isContext:true,widget:this,onHide:this._on_menuHide.$(this),shift:this._shiftMenu});if(this._sizeToFit){var r=this.getSize().x;if(s.getSize().x<r){s.setSize({x:r-q.getPaddingAndBorder(m().getElement()).x})}}if(u){u.callHooks("onMouseEnter")}}}}this.cancelCompletion()};j.cancelCompletion=function(){this.delClass("DlCompletionEntry-busy");this.__clearTimer();this.__forced=null};function f(s,r){this.__origData={value:this.getValue(),range:this.getSelectionRange()};this.__forced=r;this.addClass("DlCompletionEntry-busy");this.applyHooks("onCompletion",[this.getSelectionRange(),s,r])}function d(t){if(!i()){return false}var s=p,r;switch(t.keyCode){case DlKeyboard.ARROW_UP:if(p==null){p=0}p=c.children().rotateIndex(--p);break;case DlKeyboard.ARROW_DOWN:case DlKeyboard.TAB:if(p==null){p=-1}p=c.children().rotateIndex(++p);break;case DlKeyboard.ENTER:if(p!=null){this.collapse(false);c.children(p).callHooks("onSelect")}DlException.stopEventBubbling();case DlKeyboard.ESCAPE:this._hideMenu();var u=this.__origData;if(u){this.setValue(u.value);this.setSelectionRange(u.range)}DlException.stopEventBubbling()}if(s!=p){if(s!=null){r=c.children(s);r.callHooks("onMouseLeave")}r=c.children(p);r.callHooks("onMouseEnter");DlException.stopEventBubbling()}else{this._hideMenu()}}function l(r){if(is_ie){return d.call(this,r)}}j._handle_focusKeys=function(r){if(!DlKeyboard.KEYS_CONTROL[r.keyCode]){this._hideMenu();if(this.__timeout!=null){this.__timer=f.delayed(this.__timeout,this,r,false)}}else{if(!is_ie){if(!this.__noTab&&r.keyCode==DlKeyboard.TAB&&!i()&&!this.isEmpty()){f.call(this,r,true);r.domStop=true;DlException.stopEventBubbling()}else{return d.call(this,r)}}}return a.BASE._handle_focusKeys.call(this,r)};function b(){this.cancelCompletion()}j.completeFromWords=function(s,r){return a.completeFromWords.call(a,this,s,r)};a.completeFromWords=function(s,t,r){if(r==null){r={}}if(r.sep==null){r.sep=/\s+/g}return function(v){var u=[],x=s.getValue(),y=x.lastIndexOfRegexp(r.sep,v.start);x=x.substring(y,v.start);if(x){for(var w=0;w<t.length;++w){if(t[w].indexOf(x)==0){u.push({label:t[w],noselect:r.noselect,after:r.addSep,start:y})}}}if(u.length>0){s.completionReady(u)}else{s.cancelCompletion()}}}});DEFINE_CLASS("DlCompletionPopup",DlPopup,function(b,a){b.FIXARGS=function(c){c.zIndex=1000;c.focusable=false}});DEFINE_CLASS("DlComboBox",DlCompletionEntry,function(c,b){c.DEFAULT_ARGS={_noSelect:["noSelect",false],__smart:["smart",false],__noTab:["noTab",true],_options:["options",null],_sizeToFit:["sizeToFit",true],_electric:["electric",false]};b._createElement=function(){c.BASE._createElement.apply(this,arguments);this._makeButton(null,null,"DlComboBox-dropDownBtn",{hover:"DlComboBox-dropDownBtn-hover"}).addEventListener("onMouseDown",a.$(this));this.addEventListener("onCompletion",this.doCompletion)};b._on_menuHide=function(){c.BASE._on_menuHide.call(this);this._btn.delClass("DlComboBox-dropDownBtn-active")};function a(d){if(d.button==0){this._forcePopup();DlException.stopEventBubbling()}}b._forcePopup=function(){this._btn.addClass("DlComboBox-dropDownBtn-active");this.__forced=true;this.doCompletion(null);this.focus.delayed(0,this)};b.doCompletion=function(g){var i="",f=[];if(g){i=this.getValue().trim().toLowerCase();if(!i){return this.cancelCompletion()}}var d=this._options;if(d instanceof Function){d=d.apply(this,arguments);if(d==null){return}}d.foreach(function(j){if(j.toLowerCase().indexOf(i)==0){f.push({label:j.htmlEscape(),start:0,completion:j})}});if(f.length>0){this.completionReady(f)}else{this.cancelCompletion()}}});DEFINE_CLASS("DlDrag",DlEventProxy,function(c,b,a){c.DEFAULT_EVENTS=["onDrop","onStartDrag"];c.DEFAULT_ARGS={delta:["delta",3],dragging:["_dragging",false],draggingClass:["draggingClass","DlWidget-dragging"],_animArgs:["animation",{length:30,fps:50}],cursor:["cursor",{noDrop:"CURSOR-NO-DROP",okDrop:"CURSOR-DROP"}]};b.dropOK=function(g,f,i,d){this.target=i;return this.canDrop=true};b._handleDrop=function(f,d,g){this.applyHooks("onDrop",[f,d,g])};b.doDrop=function(f,d){throw new DlExAbstractBaseClass()};b.startOK=function(f,d){return true};b.moving=function(f,d){};b.reset=function(d){var f=this.elementCopy;if(f&&f.parentNode){if(d&&this._animArgs){var g=new DlAnimation(this._animArgs.length,this._animArgs.fps);var j=this.startElPos||this.startPos;var i=a.getPos(f);g.addEventListener({onUpdate:function(){var k=this.getPos();f.style.left=k.mapInt(i.x,j.x)+"px";f.style.top=k.mapInt(i.y,j.y)+"px";a.setOpacity(f,this.t.map(1,0.2))},onStop:function(){a.trash(f);f=null}});g.start(null,null,"accel_ab")}else{f.parentNode.removeChild(f)}}this.dragging=false;this.canDrop=false;this.target=null;this.elementCopy=null;this.startPos=null;this.source=null};b.makeElementCopy=function(g,f){var d=this.elementCopy;if(!d){d=this.elementCopy=g.getElement().cloneNode(true);a.addClass(d,"DlWidget-dragged-clone");d.style.top=f.pos.y+"px";d.style.left=f.pos.x+"px";document.body.appendChild(d);d.style.width=d.offsetWidth+"px"}return d}});DEFINE_CLASS("DlDragTreeItem",DlDrag,function(j,i){j.DEFAULT_ARGS={_noReparent:["noReparent",false]};var g="DlTreeItem-dropTarget",d="DlTreeItem-dropTarget-upper",a="DlTreeItem-dropTarget-lower",b=/DlTreeItem-dropTarget[^\s]*/g,f=/DlTreeItem-dropTarget-[^\s]*/g;function c(k){return/DlTree-IconWidth/.test(k.target.className)}i.startOK=function(l,k){return !c(k)};i.dropOK=function(n,m,o,k){while(o&&!(o instanceof DlTreeItem)){o=o.parent}var l=!k&&o;if(l){l=!this._noReparent||n.parent===o.parent}this.target=l?o:null;this.canDrop=!!l;if(this.oldTarget&&this.oldTarget!==this.target){this.oldTarget.delClass(b)}if(l){this.target.addClass(g)}this.oldTarget=this.target;return l};i.doDrop=function(l,k){if(this._noReparent||c(k)){var m=this.target.getIndex();if(!this.dropBefore){++m}this.target.parent.appendWidget(l,m);this._handleDrop(l,this.target,this.dropBefore?"before":"after")}else{if(this.target.getSubtreeWidget()!==l.parent){this.target.addSubItem(l);this._handleDrop(l,this.target)}}};i.moving=function(o,n){var p=this.target;if(this.canDrop&&p&&(this._noReparent||c(n))){var k=n.computePos(p);var m=p.getDivElement().offsetHeight/2;var l=k.y<=m;p.condClass(l,d,a);this.dropBefore=l}else{if(p){this.dropBefore=null;p.delClass(f)}}};i.reset=function(){if(this.target){this.target.delClass(b)}if(this.oldTarget){this.oldTarget.delClass(b)}j.BASE.reset.apply(this,arguments);this.oldTarget=null}});DEFINE_CLASS("DlLayout",DlContainer,function(c,b,a){c.DEFAULT_ARGS={_outerSpace:["outerSpace",0],_fillParent:["fillParent",true]};c.setFill=function(f,g){var d=f._dllayout_args.fill;f._dllayout_args.fill=g;if(g!=d){f.parent.doLayout()}};c.getArgs=function(d){return d._dllayout_args};b._appendWidgetElement=function(d,g){if(g==null){return c.BASE._appendWidgetElement.apply(this,arguments)}var f=a.createElement("div",null,{className:"DlLayout-positioned"},this.getElement());if(g.zIndex){f.style.zIndex=g.zIndex}if(g.overflow){f.style.overflow=g.overflow}f.appendChild(d.getElement());d._dllayout_args=g};b._removeWidgetElement=function(d){if(this._widgets.contains(d)){var f=d.getElement(),g=f.parentNode;if(g){g.parentNode.removeChild(g);g.removeChild(f)}}};b.packWidget=function(d,f){this.appendWidget(d,f)};b.doLayout=function(){var n=this.getInnerSize();var l,A,m,r;var j=this._outerSpace;function g(){if(typeof j=="number"){l=A=m=r=j}else{if(j instanceof Array){r=j[0];A=j[1];m=j[2];l=j[3]}else{r=j.top||0;A=j.right||0;m=j.bottom||0;l=j.left||0}}}g();var o=this._widgets;var z=new Array(o.length);var f={};for(var x=0;x<o.length;++x){var p=o[x];var k=p._dllayout_args;if(!k||!p.display()){continue}var q=p.getElement().parentNode;var y=k.before=k.before||0;var u=k.after=k.after||0;var v=k.fill;if(k.resetSize){p.getElement().style.height="";p.getElement().style.width=""}var d=p.getOuterSize();switch(k.pos){case"top":r+=y;if(v==null){v=d.y}z[x]={sy:v};if(typeof v=="number"){r+=v}r+=u;break;case"right":A+=y;if(v==null){v=d.x}z[x]={sx:v};if(typeof v=="number"){A+=v}A+=u;break;case"bottom":m+=y;if(v==null){v=d.y}z[x]={sy:v};if(typeof v=="number"){m+=v}m+=u;break;case"left":l+=y;if(v==null){v=d.x}z[x]={sx:v};if(typeof v=="number"){l+=v}l+=u;break}z[x].w=p;z[x].args=k;z[x].div=q}var t=n.x-l-A;var s=n.y-r-m;g();z.foreach(function(F,E){if(!F){$CONTINUE()}var D=F.args;var B=F.w;if(!B.display()){return}switch(D.pos){case"top":case"bottom":if(typeof F.sy!="number"){if(F.sy=="*"){F.sy=s}else{if(/%/.test(F.sy)){F.sy=Math.floor(parseFloat(F.sy)*s/100)}}if(D.min!=null&&F.sy<D.min){F.sy=D.min}if(D.max!=null&&F.sy>D.max){F.sy=D.max}s-=F.sy}break;case"left":case"right":if(typeof F.sx!="number"){if(F.sx=="*"){F.sx=t}else{if(/%/.test(F.sx)){F.sx=Math.floor(parseFloat(F.sx)*t/100)}}if(D.min!=null&&F.sx<D.min){F.sx=D.min}if(D.max!=null&&F.sx>D.max){F.sx=D.max}t-=F.sx}break}function C(){}function G(){var H=r;var w=n.y-r-m;var i={x:F.sx};switch(D.valign){case"top":break;case"center":H+=(w-B.getOuterSize().y)/2;break;case"bottom":H+=w-B.getOuterSize().y;default:i.y=w}F.div.style.top=H+"px";B.setSize(i)}switch(D.pos){case"top":r+=D.before;F.div.style.left=l+"px";F.div.style.top=r+"px";B.setSize({x:n.x-l-A,y:F.sy});r+=F.sy+D.after;break;case"bottom":m+=D.before;F.div.style.left=l+"px";F.div.style.top=n.y-m-F.sy+"px";B.setSize({x:n.x-l-A,y:F.sy});m+=F.sy+D.after;break;case"left":l+=D.before;F.div.style.left=l+"px";G();l+=F.sx+D.after;break;case"right":A+=D.before;F.div.style.left=n.x-A-F.sx+"px";G();A+=F.sx+D.after;break}})};b.__doLayout=function(){this.doLayout()};b.sizeToFit=function(){var m=this._widgets;var d=0,l=0;for(var k=0;k<m.length;++k){var g=m[k];var j=g._dllayout_args;var f=g.getOuterSize();switch(j.pos){case"top":case"bottom":d+=f.y;if(f.x>l){l=f.x}break;case"left":case"right":l+=f.x;if(f.h>d){d=f.h}break}}this.setOuterSize({x:l,y:d})}});DEFINE_CLASS("DlResizeBar",DlWidget,function(i,g,f){var a=f.condClass;i.FIXARGS=function(j){j.invert=j.invert?-1:1};i.DEFAULT_ARGS={_isHoriz:["horiz",null],_widget:["widget",null],_invert:["invert",false],_min:["min",null],_max:["max",null],_cont:["continuous",false],_keepPrc:["keepPercent",false]};i.getDragBar=function(){return DlElementCache.DRAGGING_LINE};g.initDOM=function(){i.BASE.initDOM.call(this);this.condClass(this.isHoriz(),"DlResizeBar-Horizontal","DlResizeBar-Vertical");this.setUnselectable(null,true)};g.isHoriz=function(){if(this._isHoriz==null){var j=DlLayout.getArgs(this);if(j){this._isHoriz=/top|bottom/.test(j.pos)}}return this._isHoriz};g._setListeners=function(){i.BASE._setListeners.call(this);this._resizeHandlers={onMouseMove:b.$(this),onMouseUp:d.$(this),onMouseOver:DlException.stopEventBubbling,onMouseOut:DlException.stopEventBubbling,onMouseEnter:DlException.stopEventBubbling,onMouseLeave:DlException.stopEventBubbling};this.addEventListener("onMouseDown",c)};g._setResizeCaptures=function(j){(j?DlEvent.captureGlobals:DlEvent.releaseGlobals)(this._resizeHandlers);var k=DlDialog.activateEventStopper(j);a(k,j,this.isHoriz()?"CURSOR-RESIZE-S":"CURSOR-RESIZE-E")};function c(n){var m=DlElementCache.DRAGGING_LINE;var o=this.getPos();this._dragPos=this.isHoriz()?o.y:o.x;var j=this.isHoriz()?n.pos.y:n.pos.x;this._mposDiff=j-this._dragPos;var k=this.getSize();m.style.top=o.y+"px";m.style.left=o.x+"px";m.style.width=k.x+"px";m.style.height=k.y+"px";if(this._widget){var l=this._widget instanceof DlWidget?this._widget.getSize():f.getOuterSize(this._widget);this._dragSize=this.isHoriz()?l.y:l.x}document.body.appendChild(m);this._setResizeCaptures(true);DlException.stopEventBubbling()}g._doResize=function(n){var k=this.isHoriz();var q=f.getPos(DlElementCache.DRAGGING_LINE);q=k?q.y:q.x;var p=this._invert*(q-this._dragPos);var j=this._widget;if(j){var m=this._dragSize;if(j instanceof DlWidget){var o=DlLayout.getArgs(j);if(o){o=o.fill;var l=/%$/.test(o);if(l&&!this._keepPrc||o==null||typeof o=="number"){DlLayout.setFill(j,m+p)}else{if(l){o=parseFloat(o);DlLayout.setFill(j,o*(m+p)/m+"%")}}}else{if(this._isHoriz){j.setSize({y:m+p})}else{j.setSize({x:m+p})}}}else{if(this._isHoriz){f.setOuterSize(j,null,m+p)}else{f.setOuterSize(j,m+p,null)}}}};function d(j){this._setResizeCaptures(false);this._doResize(j);document.body.removeChild(DlElementCache.DRAGGING_LINE)}function b(n){var j=DlElementCache.DRAGGING_LINE;var m=this.isHoriz()?n.pos.y:n.pos.x;m-=this._mposDiff;var p=this._invert*(m-this._dragPos);var k=this._min,o=this._max,q=this._widget;if(q){var l=DlLayout.getArgs(q);if(l){if(k==null){k=l.min}if(o==null){o=l.max}}var r;if(k!=null||o!=null){r=this._dragSize+p}if(k!=null&&r<k){m+=this._invert*(k-r)}else{if(o!=null&&r>o){m+=this._invert*(o-r)}}}if(this.isHoriz()){j.style.top=m+"px"}else{j.style.left=m+"px"}if(this._cont){this._doResize(n)}}});DEFINE_CLASS("DlWM",DlContainer,function(a,c,k){c.getInnerSize=c.getOuterSize=c.getSize=function(){return(this.parent?this.parent.getInnerSize():k.getWindowSize())};c.initDOM=function(){a.BASE.initDOM.apply(this,arguments);this.getElement().innerHTML="<div class='DlWM-modalStopper'></div>";this.dialogsVisible=[];this.modalsVisible=0;this._manageEvents={onShow:j.$(null,this),onHide:f.$(null,this)};var l=this.on_parentResize.$(this);this.parent?this.parent.addEventListener("onResize",l):k.addEvent(window,"resize",l)};c.getModalStopperElement=function(){return this.getElement().childNodes[0]};c.activatePrev=function(){var l=this.dialogsVisible;if(l.length>1){l.peek().deactivate();l.unshift(l.pop());top=l.pop();top.activate()}};c.activateNext=function(){var l=this.dialogsVisible;if(l.length>1){l[0].activate()}};c.getActiveDialog=function(){return this.dialogsVisible.peek()};c.updateZIndex=function(){this.dialogsVisible.r_foreach(function(m,l){m.zIndex((m.__modal?900:500)+l)})};c.getVisibleDialogs=function(){return this.dialogsVisible};c.getAllDialogs=function(){return this.children().grep(function(l){return l instanceof DlDialog})};c.appendWidget=function(l){a.BASE.appendWidget.apply(this,arguments);if(l instanceof DlDialog){this.manage(l)}};c.removeWidget=function(l){a.BASE.removeWidget.apply(this,arguments);if(l instanceof DlDialog){this.unmanage(l)}};c.manage=function(l){l.addEventListener(this._manageEvents)};c.unmanage=function(l){l.removeEventListener(this._manageEvents)};c.on_dlgShow=function(l){if(l.__modal){this.modalsVisible++}this.condClass(this.modalsVisible>0,"DlWM-hasModals")};c.on_dlgHide=function(l){if(l.__modal){this.modalsVisible--}this.condClass(this.modalsVisible>0,"DlWM-hasModals");if(this.dialogsVisible.length==0&&this.parent){this.parent.focus()}};c.on_parentResize=function(){this.dialogsVisible.foreach(function(l){if(l.__maximized){l.__doMaximize()}});this.callHooks("onResize")};c.rearrange=function(m){var l=this.dialogsVisible.map(function(o){var p=o.getOffsetPos(),n=o.getOuterSize();return{dlg:o,x:p.x,y:p.y,w:n.x,h:n.y}});m(l,this.getInnerSize());l.foreach(function(n){n.dlg.setPos(n.x,n.y);n.dlg.setSize({x:n.w,y:n.h})})};c.tileHoriz=function(){this.rearrange(d)};c.tileVert=function(){this.rearrange(b)};function j(l){l.on_dlgShow(this)}function f(l){l.on_dlgHide(this)}DlContainer.prototype._makeWindowManager=function(){if(!this.__wm){(this.__wm=new DlWM({parent:this})).addEventListener("onDestroy",function(){this.__wm=null}.$(this))}return this.__wm};function i(m,l){return m.x<l.x?-1:m.x>l.x?1:0}function g(m,l){return m.y<l.y?-1:m.y>l.y?1:0}function d(o,p){var q=o.length,m=Math.floor(p.x/q),l=0;o.mergeSort(i).foreach(function(r,n){r.y=0;r.x=l;r.h=p.y;if(n==q-1){r.w=p.x-l}else{r.w=m}l+=m})}function b(l,m){var q=l.length,o=Math.floor(m.y/q),p=0;l.mergeSort(g).foreach(function(r,n){r.x=0;r.y=p;r.w=m.x;if(n==q-1){r.h=m.y-p}else{r.h=o}p+=o})}});DEFINE_CLASS("DlDialog",DlContainer,function(q,d,z){var s=DlException.stopEventBubbling,u=z.addClass,x=z.delClass,k=z.condClass,g=z.createElement;q.DEFAULT_EVENTS=["onShow","onHide","onActivate","onQuitBtn"];q.DEFAULT_ARGS={_title:["title","DlDialog"],_fixed:["fixed",false],_resizable:["resizable",false],_focusable:["focusable",true],_iconClass:["iconClass",null],_focusedWidget:["focusDefault",null],__noShadows:["noShadows",false],__quitBtn:["quitBtn",false],__maxBtn:["maxBtn",true],__modal:["modal",false],__moveDelay:["moveDelay",5000]};q.FIXARGS=function(C){if(!C.parent){C.parent=q.getTopWM()}if(!(C.parent instanceof DlWM)){if(C.parent instanceof DlDialog){C.noShadows=true}C.parent=C.parent._makeWindowManager()}};q.CONSTRUCT=function(){this.__doDrag=this.__moveDelay!=null?p.clearingTimeout(this.__moveDelay,this):p.$(this);this.active=false};var i;q.getTopWM=function(){if(!i){i=new DlWM({});document.body.appendChild(i.getElement())}return i};var y=("<table cellspacing='0' cellpadding='0'><tr><td><div class='DlDialog-Rel'><div class='DlDialog-WindowButtons'></div><div class='DlDialog-Title'><div></div></div><div class='DlDialog-Content'></div></div></td></tr></table>");var o={x:-30000,y:-30000};d._setDragCaptures=function(C){DlEvent[C?"captureGlobals":"releaseGlobals"](this._dragHandlers)};d._setResizeCaptures=function(C){DlEvent[C?"captureGlobals":"releaseGlobals"](this._resizeHandlers)};function f(){var C=z.CE_CACHE["DlDialog.EVENT_STOPPER"];if(!C){C=z.CE_CACHE["DlDialog.EVENT_STOPPER"]=g("div",null,{className:"DYNARCH-EVENT-STOPPER"},document.body)}C.style.visibility="";return C}function A(){var C=z.CE_CACHE["DlDialog.EVENT_STOPPER"];if(C){C.className="DYNARCH-EVENT-STOPPER";C.style.visibility="hidden"}return C}q.activateEventStopper=function(C){return C?f():A()};function a(D){if(!this.dragging&&!this.__maximized){DlPopup.clearAllPopups();this.activate();this.dragging=true;D||(D=window.event);var C=(D instanceof DlEvent)?D:new DlEvent(D);this.addClass("DlDialog-Dragging");this._dragPos=C.computePos(this);this._setDragCaptures(true);u(f(),"CURSOR-DRAGGING");if(this.__moveDelay!=null){var F=this.getResizeRect();u(F,"Dl-ResizeRect-moving");var E=this.getOuterSize();z.setPos(F,C.elPos.x,C.elPos.y);z.setOuterSize(F,E.x,E.y);F.style.display=""}if(C!==D){return z.stopEvent(D)}}}function r(C){if(C.ctrlKey&&C.shiftKey){if(C.button==0&&this._dragHandlers){a.call(this,C)}else{if(C.button==2&&C.dl_type=="onContextMenu"&&this._resizable){l.call(this,C);s()}}}}function v(C){if(this.dragging){var E=this.getResizeRect();this.dragging=false;this.delClass("DlDialog-Dragging");this._setDragCaptures(false);if(this.__moveDelay!=null){if(C){var D=n.call(this,C);this.__doDrag.doItNow(D.x,D.y)}else{this.__doDrag.cancel()}}x(E,"Dl-ResizeRect-moving");E.style.display="none";A()}}function n(E){var G=this.parent;E.computePos(G.getContentElement());var C=E.relPos.x-this._dragPos.x,H=E.relPos.y-this._dragPos.y,F=this.getOuterSize(),D=G.getInnerSize();if(C<0){C=0}else{if(C+F.x>D.x){C=D.x-F.x}}if(H<0){H=0}else{if(H+F.y>D.y){H=D.y-F.y}}return{x:C,y:H}}function B(E){var C=E.x,D=E.y;E=z.getPos(this.parent.getContentElement());C+=E.x;D+=E.y;z.setPos(this.getResizeRect(),C,D)}function p(C,D){this.setPos(C,D);this.__oldDlgPos=this.getOffsetPos()}function w(C){var D=n.call(this,C);if(this.__moveDelay!=null){B.call(this,D)}this.__doDrag(D.x,D.y);s()}function l(D){if(!this.resizing){this.resizing=true;D||(D=window.event);var C=(D instanceof DlEvent)?D:new DlEvent(D);this._dragPos=C.computePos(this);var E=this.getOuterSize();this._dragPos.x-=E.x;this._dragPos.y-=E.y;var G=this.getPos();var F=this.getResizeRect();z.setPos(F,G.x,G.y);z.setOuterSize(F,E.x,E.y);F.style.display="";this.addClass("DlDialog-Resizing");this._setResizeCaptures(true);u(f(),"CURSOR-DRAGGING");c.call(this,C,true);if(C!==D){z.stopEvent(D)}}}function j(C){if(this.resizing){this.disableHooks("onResize");this.getElement().style.overflow="hidden";var E=this.getResizeRect();var D=z.getOuterSize(E);z.setPos(E,0,0);E.style.display="none";this.delClass("DlDialog-Resizing");D.x--;if(is_gecko){D.y--}if(this.__noShadows){D.x-=4;D.y-=4}this.setOuterSize({x:D.x,y:D.y});if(is_gecko){q.BASE.setOuterSize.call(this,{x:"auto",y:"auto"})}this.resizing=false;this._setResizeCaptures(false);this.getElement().style.overflow="";A();this.enableHooks("onResize");this.callHooks("onResize")}}function c(D,C){if(this.resizing){var F=this.getResizeRect();var E=z.getPos(F);E.x=D.pos.x-this._dragPos.x-E.x-1;if(E.x<100){E.x=100}E.y=D.pos.y-this._dragPos.y-E.y-1;if(E.y<100){E.y=100}if(this._resizable===1){E.y=null}if(this._resizable===2){E.x=null}z.setInnerSize(F,E.x,E.y);C||s()}}d.setOuterSize=d.setSize=function(C){if(C.y!=null){C.y-=this.getTitleElement().offsetHeight}this.setInnerSize(C)};d.hide=function(){if(this.display()&&z.elementIsVisible(this.getElement())){this.__oldDlgPos=this.getOffsetPos();this.display(false);this.setPos(o)}};d.show=function(C){if(!this.__wasDisplayed){this.setStyle({visibility:""})}if(!this.display()||!this.__wasDisplayed){if(this.__oldDlgPos){this.setPos(this.__oldDlgPos)}else{if(C){this.centerOnParent()}}this.display(true)}else{this.activate()}this.__wasDisplayed=true};d.activate=function(){var D=this.parent.getVisibleDialogs();var C=D.peek();if(!this.active){if(C&&C.active){C.deactivate(true)}this.addClass("DlDialog-Active");D.remove(this);D.push(this);this.parent.updateZIndex();this.active=true;this.focus();if(this._focusedWidget&&!this._focusedWidget.destroyed){this._focusedWidget.focus()}this.applyHooks("onActivate",[true])}};d.deactivate=function(){if(this.active){this.delClass("DlDialog-Active");this.active=false;this.blur();this.applyHooks("onActivate",[false])}};function b(C,F){var E=DlSystem();if(C){this.callHooks("onShow");this.activate();this.setModal(this.__modal,true);E.applyHooks("on-dialog-show",[this]);if(this.__maximized){this.__doMaximize.delayed(1,this)}}else{var D=this.parent.getVisibleDialogs();D.remove(this);this.callHooks("onHide");this.deactivate();E.applyHooks("on-dialog-hide",[this]);if(D.length>=1){D.peek().activate()}}}function m(C){if(C.shiftKey||C.altKey){var D=this.__dlgOpacity;if(D==null){D=100}if(C.wheelDelta>0){D+=0.05}else{D-=0.05}D=this.__dlgOpacity=D.limit(0.1,1);this.opacity(D);s()}}d._createElement=function(){q.BASE._createElement.call(this);this.setPos(o);this.setStyle({visibility:"hidden"});this.getElement().innerHTML=y;var C=this.getRelElement();if(!this.__noShadows&&!is_ie6){C.insertBefore(DlElementCache.get("SHADOWS"),C.firstChild)}else{this.__noShadows=true;u(C,"DlDialog-noShadows")}this.title(this._title);this.setUnselectable(this.getTitleElement());var D=this.__quitBtn;if(D){var E=this.__quitBtn=new DlAbstractButton({parent:this,className:"DlDialog-QuitBtn",appendArgs:this.getButtonsElement(),classes:{hover:"DlDialog-QuitBtn-hover",active:"DlDialog-QuitBtn-active"}});if(D=="destroy"){D=this.destroy.$(this)}else{if(D=="hide"){D=this.hide.$(this)}}if(D instanceof Function){E.addEventListener("onClick",D)}else{E.connectEvents("onClick",this,"onQuitBtn")}}if(this._resizable){this.makeResizable()}this.setIconClass(this._iconClass);if(!this._fixed){this.makeDraggable()}this.addEventListener({onMouseDown:this.activate,onMouseWheel:m,onDisplay:b,onDestroy:this.hide})};d.setIconClass=function(C){var D=this.getTitleElement().firstChild;k(D,C!=null,"DlDialog-Title-withIcon");if(this.iconClass){x(D,this.iconClass)}if(C){u(D,C)}this.iconClass=C};d.getState=function(){var C=this.__maximized&&this.__maximizeSavePos;if(C){C=Object.makeDeepCopy(C)}else{C={pos:this.getOffsetPos(),size:this.getOuterSize()}}C.max=!!this.__maximized;return C};d.maximize=function(E){if(E==null){E=this.__maxBtn.checked()}var D,C;this.__maximized=E;if(E){D=this.getOffsetPos();C=this.getOuterSize();this.__maximizeSavePos={pos:D,size:C}}this.condClass(E,"DlDialog-Maximized");if(E){this.__doMaximize()}else{D=this.__maximizeSavePos;C=D.size;D=D.pos;this.setOuterSize({x:C.x,y:C.y});this.setPos(D.x,D.y)}this.__maxBtn.checked(E,true);if(this._focusedWidget){this._focusedWidget.focus()}};d.__doMaximize=function(){this.setPos(0,0);var C=this.parent.getInnerSize();if(this.__noShadows){C.x-=4;C.y-=4}this.setOuterSize({x:C.x,y:C.y})};d.setModal=function(C,D){if(!D){this.__modal=C}if(this.display()){this.parent.updateZIndex()}};d.makeResizable=function(){if(!this._resizeHandlers){this.getContentElement().style.overflow="hidden";var D=this.getRelElement();var C=g("div",null,{className:"ResizeHandle"},null);D.insertBefore(C,D.firstChild);this._resizeHandlers={onMouseMove:c.$(this),onMouseUp:j.$(this),onMouseOver:s,onMouseOut:s,onMouseEnter:s,onMouseLeave:s};z.addEvent(C,"mousedown",l.$(this));this.resizing=false;if(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))}}};d.makeDraggable=function(){if(!this._dragHandlers){var C=this.getTitleElement();C.style.cursor="default";this._dragHandlers={onMouseMove:w.$(this),onMouseUp:v.$(this),onMouseOver:s,onMouseOut:s,onMouseEnter:s,onMouseLeave:s};z.addEvent(C,"mousedown",a.$(this));this.addEventListener(["onMouseDown","onContextMenu"],r);this.dragging=false}};d.title=function(C){if(C!=null){if(C instanceof Array){C=C.join("")}this._title=C;this.getTitleElement().firstChild.innerHTML=C}return this._title};d._handle_focusKeys=function(D){if(!D.altKey&&!D.ctrlKey){if(D.keyCode==DlKeyboard.ESCAPE){if(!this.dragging&&this.__quitBtn){this.__quitBtn.keyClicked(D)}else{if(this.dragging){v.call(this)}}}else{if(D.keyCode==DlKeyboard.TAB){var C=D.focusedWidget;C=D.shiftKey?this.getPrevFocusWidget(C):this.getNextFocusWidget(C);if(C){C.focus()}D.domStop=true;s()}}}this._handleKeybinding(D)};function t(E,D){var C=E.getRelElement().childNodes;return C[C.length-D]}d.getRelElement=function(){return this.getElement().firstChild.rows[0].cells[0].firstChild};d.getContentElement=function(){return t(this,1)};d.getTitleElement=function(){return t(this,2)};d.getButtonsElement=function(){return t(this,3)};d.centerOnParent=function(){var C=this.getOuterSize(),D=this.parent.getOuterSize();this.setPos((D.x-C.x)/2,(D.y-C.y)/2)};d.getWM=function(){return this.parent};DlWidget.prototype.getParentDialog=function(){var C=this.parent;while(C&&!(C instanceof q)){C=C.parent}return C}});DEFINE_CLASS("DlDialogPopup",DlPopup,function(b,a){b.FIXARGS=function(c){c.autolink=false;c.zIndex=5000}});DEFINE_CLASS("DlRecord",DlEventProxy,function(b,a){b.DEFAULT_EVENTS=["onChange"];b.DEFAULT_ARGS={_data:["data",null],_set:["recordSet",null]};a.id=function(){return this._data.id};a.get=function(c){return this._data[c]};a.set=function(g,i,f){var d,c=this._data[g];this._data[g]=i;if(!f){d=[this,g,i,c];this.applyHooks("onChange",d);this._set&&this._set.applyHooks("onChange",d)}};a.compareTo=function(g,f){var d=this.get(f),c=g.get(f);return d<c?-1:d==c?0:1}});DEFINE_CLASS("DlRecordCache",DlEventProxy,function(b,a){b.DEFAULT_EVENTS=["onChange","onInsert","onDelete","onRefresh"];b.DEFAULT_ARGS={_data:["data",null]};b.CONSTRUCT=function(){this._init()};a.get=function(c){return this._data[c]};a.hasRecord=function(c){return this.get(c)};a.getRecords=function(c,f,d){f.call(d,c.map(this.get,this))};a.getAllIds=function(){return Array.hashKeys(this._data)};a.getAllRecords=function(){return Array.hashValues(this._data)};a.getHash=function(){return this._data};a.formatHTML=function(f,d,c){c(f.get(d).toString().htmlEscape())};a.getRecClass=function(c){};a.getCellClass=function(d,c){};a.getInsertPos=function(c){};a.insert=function(d,c){if(c==null){c=this.getInsertPos(d)}this._data[d.id()]=d;d._set=this;this.applyHooks("onInsert",[d,c])};a.remove=function(c){if(c instanceof Array){c.foreach(function(d){delete this._data[d]},this)}else{delete this._data[c]}this.applyHooks("onDelete",[c])};a.sort=function(g,f,i,d,k,j){var c;if(f==i&&d!==null){c=g.reverse()}else{c=g.mergeSort(function(m,l){m=this.get(m);l=this.get(l);return m.compareTo(l,f)}.$(this),d)}k.call(j,c)};a._init=function(){if(!this._data){this._data={}}else{var c={};this._data.foreach(function(d){c[d.id()]=d;d._set=this},this);this._data=c}}});DEFINE_CLASS("DlDataGridHeadLabel",DlButton,function(a,g,k){a.BEFORE_BASE=function(){this.__withIconClass="DlButton-withIcon"};a.FIXARGS=function(l){if(!("contextMenu" in l)){l.contextMenu=this._getContextMenu}};a.CONSTRUCT=function(){if(!this.isSortable()){var l=this._classes=Object.makeCopy(this._classes);l.active=l.hover=null}};var d=20;g.setWidth=function(l){this.setOuterSize({x:l})};g.isSortable=function(){return this.col.isSortable()};g._onClick=function(){if(this.isSortable()){this.parent._onHeadClick(this.col,this)}};g._getContextMenu=function(){var l=this._dgContextMenu,o=this.parent,n;if(!l){this._dgContextMenu=l=new DlVMenu({});n=l.buttons=[];o._cols.foreach(function(p,q){if(p.getMenuLabel()){var m=n[q]=new DlCheckbox({parent:l,label:p.getMenuLabel(),checked:p.isVisible()});m.addEventListener("onChange",function(){p.setVisible(this.checked())})}})}else{n=l.buttons;o._cols.foreach(function(m,p){n[p].checked(m.isVisible(),true)})}return l};a.DEFAULT_ARGS={col:["col",null],_focusable:["focusable",false],_noCapture:["noCapture",true],_classes:["classes",{active:"DlDataGridHeadLabel-active",hover:"DlDataGridHeadLabel-hover",checked:"DlDataGridHeadLabel-1",unchecked:"DlDataGridHeadLabel-0",empty:"DlDataGridHeadLabel-empty",disabled:"DlDataGridHeadLabel-disabled"}]};var b=DlException.stopEventBubbling;function c(l){var m=l._resizeHandle;if(!m){m=l._resizeHandle=new DlWidget({parent:l,className:"DlDataGrid-resizeHandle"});m.display(false);m.grid=l.parent;m.addEventListener({onMouseLeave:m.display.$(m,false),onMouseDown:f});m._resizeCaptures={onMouseMove:j.$(m),onMouseUp:i.$(m),onMouseOver:b,onMouseOut:b,onMouseEnter:b,onMouseLeave:b}}return m}a._on_headMouseMove=function(p){if(!this._colPos||this.dragging){return}var o=this.parent,m=o.getBodyDiv().scrollLeft;var l=p.computePos(this).x+m;var q;this._colPos.foreach(function(r){if(Math.abs(l-r.pos)<4){if(r.col.isResizable()){q=r}$BREAK()}});var n=c(this);if(q){if(q.col!==n.col){n.found=q;n.col=q.col;n.pos=q.pos;n.setPos(q.pos-m)}n.display(true)}else{n.display(false);n.found=n.col=null}};a._on_headMouseLeave=function(l){c(this).display(false)};function f(n){this.dragging=true;var m=DlResizeBar.getDragBar(),l=m.style;this.sl=this.grid.getBodyDiv().scrollLeft;l.left=this.pos-this.sl-1+"px";l.height="100%";l.width=this.getElement().offsetWidth-4+"px";l.top="0px";this.grid.getElement().appendChild(m);var o=DlDialog.activateEventStopper(true);k.addClass(o,"CURSOR-RESIZE-E");DlEvent.captureGlobals(this._resizeCaptures);this.origW=this.grid.getColWidth(this.col);this.origM=n.pos.x;this.col._button.addClass("DlDataGridHeadLabel-resizing");b()}function j(o){var n=DlResizeBar.getDragBar(),q=this.pos+o.pos.x-this.origM-1,p=q-this.pos,l=this.origW+p;if(l<d){q+=d-l;l=d}q-=this.sl;n.style.left=q+"px";this.width=l;this.diff=p;if(!is_ie){var m=this.col._button.getElement();m.style.width=m.parentNode.style.width=m.parentNode.parentNode.style.width=l+"px"}b()}function i(m){this.dragging=false;this.grid.getElement().removeChild(DlResizeBar.getDragBar());var n=DlDialog.activateEventStopper(false);k.delClass(n,"CURSOR-RESIZE-E");DlEvent.releaseGlobals(this._resizeCaptures);if(this.width){this.grid.setColWidth(this.col,this.width);this.grid._computeColPos()}this.col._button.delClass("DlDataGridHeadLabel-resizing");if(!is_ie){var l=this.col._button.getElement();l.style.width=l.parentNode.style.width=l.parentNode.parentNode.style.width=""}this.width=this.diff=this.found=this.col=null;this.parent.callHooks("onMouseMove",m);b()}});DEFINE_CLASS("DlGridCol",DlEventProxy,function(c,b){c.DEFAULT_EVENTS=["onChange","onVisibility"];c.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",true],_isResizable:["resizable",true],_cssRule:["cssRule",null],_isVisible:["visible",true]};var a={};b.id=function(){return this._field_id};b.getWidth=function(){return this._width};b.getFill=function(){return this._fill};b.getLabel=function(){return this._label};b.getMenuLabel=function(){return this._menuLabel||this._label};b.getTooltip=function(){return this._tooltip};b.getIconClass=function(){return this._iconClass};b.getStyle=function(d,f){return(this._style||a)[d]||f};b.isSortable=function(){return this._isSortable};b.isResizable=function(){return this._isResizable};b.isVisible=function(){return this._isVisible};b.setVisible=function(d){this._isVisible=d;this.applyHooks("onVisibility",[d])};b.sort=function(){}});DEFINE_CLASS("DlGridDragCol",DlDrag,function(D,P,DOM){D.CONSTRUCT=function(){this.addEventListener("onStartDrag",function(w){this.grid_pos=w.parent.getPos();w._onMouseLeave()})};P.startOK=function(widget,ev){return true};P.dropOK=function(widget,ev,target,inside){if(!inside&&target instanceof DlDataGridHeadLabel&&widget.parent===target.parent){this.target=target;return this.canDrop=true}return this.canDrop=false};P.doDrop=function(widget,ev){widget.parent.reorderColumn(widget.col,this.target.col,!this.dropBefore)};var DROP_INDICATOR;function getDropIndicator(){var d=DROP_INDICATOR;if(!d){d=DROP_INDICATOR=DOM.createElement("div",{display:"none"},{className:"DlDataGrid-drop-col"},document.body)}return d}P.moving=function(widget,ev){var target=this.target;var di=getDropIndicator();if(this.canDrop&&target){var relPos=ev.computePos(target);var te=target.getElement();var w=te.offsetWidth;var before=relPos.x<=w/2;var pos=target.col.index;if(before){pos--}if(pos<0){pos=0}else{pos=widget.parent._headCont._colPos[pos].pos-widget.parent.getBodyDiv().scrollLeft}with(di.style){display="block";left=pos+this.grid_pos.x+"px";top=relPos.elPos.y+"px"}this.dropBefore=before}else{if(target){this.dropBefore=null;di.style.display="none"}}};P.reset=function(){if(DROP_INDICATOR){DROP_INDICATOR.style.display="none"}D.BASE.reset.apply(this,arguments)}});DEFINE_CLASS("DlSelectionModel",DlEventProxy,function(b,a){b.DEFAULT_EVENTS=["onChange","onReset"];b.CONSTRUCT=function(){if(!this.sel){this.sel={}}};b.DEFAULT_ARGS={multiple:["multiple",true],sel:["sel",null]};a.reset=function(d,f){var c=this.sel;this.sel=d.toHash(true);if(!f){this.applyHooks("onReset",[c,this.sel])}};a.clear=function(c){this.reset([],c)};a.get=function(){return this.sel};a.getArray=function(){return Array.hashKeys(this.sel)};a.getFirst=function(){for(var c in this.sel){return c}};a.isSelected=function(c){return this.sel[c]};a.size=function(){var d=0;for(var c in this.sel){d++}return d};a.filter=function(f){var d=[];for(var c in this.sel){if(!(c in f)){d.push(c)}}this.unselect(d)};a.select=function(i,g){var f=this.sel,c=null,d;if(i instanceof Array){d={};i.foreach(function(j){if(!f[j]){f[j]=d[j]=true;c=true}},this);if(!g&&c!=null){this.applyHooks("onReset",[{},d])}}else{if(!f[i]){f[i]=true;if(!g){this.applyHooks("onChange",[i,true])}c=true}}return c};a.unselect=function(i,g){var f=this.sel,c=null,d;if(i instanceof Array){d={};i.foreach(function(j){if(f[j]){delete f[j];d[j]=true;c=false}},this);if(!g&&c!=null){this.applyHooks("onReset",[d,{}])}}else{if(f[i]){delete f[i];if(!g){this.applyHooks("onChange",[i,false])}c=false}}return c};a.toggle=function(d,c){return this.sel[d]?this.unselect(d,c):this.select(d,c)}});DEFINE_CLASS("DlDataGrid",DlContainer,function(a,j,l){var i=l.addClass,g=l.delClass,k=l.condClass;a.DEFAULT_EVENTS=["onBodyDblClick","onBodyScroll"];a.CONSTRUCT=function(){this.__scrollConts=0};var c=DlException.stopEventBubbling;a.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",true],_cols:["cols",null],_headType:["headType",DlDataGridHeadLabel],_focusable:["focusable",true],_rtClickKeepSel:["rightClickKeepsSel",false],_rarify:["rarifyScroll",null]};var f=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();j.getHeaderDiv=function(){return this.getElement().firstChild};j.getHeaderTable=function(){return this.getHeaderDiv().firstChild};j.getHeaderRow=function(){return this.getHeaderDiv().firstChild.rows[0]};j.getBodyDiv=function(){return this.getElement().childNodes[1]};j._getVSHeightDiv=function(){return this.getBodyDiv().firstChild};j._getVSScrollDiv=function(){return this._getVSHeightDiv().firstChild};j.getRowsContainer=function(){return this._getVSHeightDiv().childNodes[1]};j.resetIDS=function(n){var m={},o=this._selection;n.foreach(function(q,p){m[q]=p});this._records={array:n,id_to_pos:m};o.filter(m);if(o.getArray().length==0){o._last=null}};j._fetch_data=function(m,r,z){var t=this._minReqRows,q=m.length,w=this._data;if(t==null||t<=q){w.getRecords(m,z,this)}else{var x=m.slice(0);var y=this._records.array,u;var v=this._threshold||Math.ceil(this._rpp/2);if(r<=0){var p=this._records.id_to_pos[m[0]],s=v;while(s-->0){if(!w.hasRecord(y[--p])){break}}if(s>0){for(u=p;u>=0&&x.length<t;u--){var o=y[u];if(!w.hasRecord(o)){x.push(o)}}}}if(r>=0){var p=this._records.id_to_pos[m.peek()],s=v;while(s-->0){if(!w.hasRecord(y[++p])){break}}if(s>0){for(u=p;u<y.length&&x.length<t;u++){var o=y[u];if(!w.hasRecord(o)){x.push(o)}}}}w.getRecords(x,function(n){z.call(this,n.slice(0,q))},this)}};j._display_ids=function(n,m){this._info_display={length:n.length,first_row_index:this._records.id_to_pos[n[0]],last_row_index:this._records.id_to_pos[n.peek()]};this._fetch_data(n,0,function(o){var p=String.buffer();o.foreach(this._fetchRowHTML.$(this,p));this.getRowsContainer().innerHTML=p.get();if(m!=null){this._setVScroll(m)}this._resetVSHeight();if(o.length>1){this.scrollToRecord(o[1].id())}else{this._setVScroll(this.getBodyDiv().scrollTop=0)}this.getBoundRecords()})};j.displayPage=function(n){if(n==null){n=0}this._page=n;var m=this._records.array;if(this._rpp){var o=n*this._rpp;m=m.slice(o,o+this._rpp)}this._display_ids(m)};j._resetVSHeight=function(){if(this._vScroll&&this._info_display){h=Math.floor(this.getRowsContainer().offsetHeight*this.getNRecords()/this._info_display.length);this._getVSHeightDiv().style.height=isNaN(h)?"":h+"px"}};j._setVScroll=function(n){var m=this._getVSScrollDiv();if(n){m.style.height=n+"px";m.style.display="block"}else{m.style.display="none"}};j.initWidths=function(){var n={};this._cols.foreach(function(t){n[t.id()]=this.getColWidth(t)},this);var m=this.getRowsContainer();for(var r=m.firstChild;r;r=r.nextSibling){var p=r.firstChild.rows[0].cells;for(var o=p.length;--o>=0;){var s=p[o];var q=s.getAttribute("colid");n[q]=Math.max(n[q]||0,s.offsetWidth)}}this._cols.foreach(function(t){this.setColWidth(t,n[t.id()])},this)};j.resetColumns=function(o){var q=this.getHeaderRow();var n=q.cells;var m=[];this._cols=o.map(function(t,s){var r=this._colsById[t.id];m.push(n[r.index]);r.index=s;r._width=t.width;r._isVisible=t.visible;return r},this);var p=document.createDocumentFragment();m.foreach(function(r){p.appendChild(r)});q.appendChild(p);this.refreshDisplay();this._cols.foreach(function(r){this.setColVisible(r,r.isVisible());this.setColWidth(r,r.getWidth())},this)};j.reorderColumn=function(t,p,s){var o=t.index,r=p.index;if(s){r++}var m=this._cols;m.splice(o,1);m.splice(o<r?r-1:r,0,t);for(var q=0;q<m.length;++q){m[q].index=q}for(var q=this.getRowsContainer().firstChild;q;q=q.nextSibling){var n=q.firstChild.rows[0].cells;var t=n[o],p=n[r];t.parentNode.insertBefore(t,p||null)}var n=this.getHeaderRow().cells;var t=n[o],p=n[r];t.parentNode.insertBefore(t,p||null);this._computeColPos()};j.getNRecords=function(){return this._records?this._records.array.length:0};j.getNPages=function(){if(!this._rpp){return 1}return Math.ceil(this.getNRecords()/this._rpp)};j.rec_isSelected=function(m){return this._selection.isSelected(m.id())};j._computeColPos=function(){var m=-1;this._headCont._colPos=this._cols.map(function(n){m+=this.getColWidth(n);return{pos:m,col:n}},this)};j._createElement=function(){a.BASE._createElement.call(this);this.getElement().id=this.id;this._ss=new DlStyleSheet();this._cssPrefix="#"+this.id;this.setContent(f);this._initHeaders();this.getBodyDiv().onscroll=this._rarify?d.rarify(this._rarify.calls,this._rarify.timeout,this):d.$(this);var m=this._headCont=new DlContainer({parent:this,element:this.getHeaderDiv()});m.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(n){this.addEventListener(n,this["_body_"+n])},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);if(this._records){this.resetIDS(this._records)}this._sel_events={onChange:this._sel_onChange.$(this),onReset:this._sel_onReset.$(this)};if(!this._selection){this._selection=new DlSelectionModel({})}this.setSelectionModel(this._selection)};j._onDestroy=function(){this.setCache(null);this._ss.destroy()};j.setCache=function(m){if(this._data){this._data.removeEventListener(this._cacheEvents)}this._data=m;if(m){m.addEventListener(this._cacheEvents)}};j._data_onChange=function(o){var n=this.getRowElement(o.id());if(n){var m=String.buffer();this._fetchRowHTML(m,o);m=m.get();if(is_ie){n.outerHTML=m}else{var p=l.createFromHtml(m);l.trash(n.parentNode.replaceChild(p,n))}}};j._data_onInsert=function(o,n){var m=this._records.array;if(n==null){n=m.length}m.splice(n,0,o.id());this.resetIDS(m);this.refreshDisplay()};j._data_onDelete=function(n){var m=this._records.array;if(n instanceof Array){n.foreach(function(o){this.remove(o)},m)}else{m.remove(n)}this.resetIDS(m);this.refreshDisplay()};j._data_onRefresh=function(){};j._recompDynamicWidths=function(){var n=this.getBodyDiv().clientWidth;var m=[];this._cols.foreach(function(o){if(o.getFill()==null){n-=this.getColWidth(o)}else{m.push(o)}},this);n-=1;m.foreach(function(o){this.setColWidth(o,n*o.getFill())},this)};j._initHeaders=function(){this._colsById={};this._cols.foreach(function(n,q){if(!(n instanceof DlGridCol)){n=this._cols[q]=new DlGridCol(n)}n.addEventListener("onVisibility",this.setColVisible.$(this,n));n.index=q;this._colsById[n.id()]=n;var m="DlDataGrid-col-"+n.id();var s=this._cssPrefix+" ."+m;s=s+","+s+" .DlDataGrid-cellData";var p=["text-align:"+n.getStyle("textAlign","left")];var r=n.getWidth();if(typeof r=="number"){p.push("width:"+r+"px")}p=p.join(";");n._cssRule=this._ss.insertRule(s,p);if(!n.isVisible()){this._ss.modifyRule(n._cssRule,{display:"none"})}var t=document.createElement("td");t.innerHTML="<div class='DlDataGrid-cellData'></div>";t.className=m;this.getHeaderRow().appendChild(t);var o=this._makeHeadLabel({parent:this,appendArgs:t.firstChild,iconClass:n.getIconClass(),label:n.getLabel(),col:n,className:"DlGrid-align-"+n.getStyle("textAlign","left"),tooltip:n.getTooltip.$(n),drag:this._getDragObject()});n._button=o},this)};j.findRowFromEvent=function(m){return b(m)};function b(r){var t=r.target,u,o,n,s,m;try{while(t){m=t.tagName.toLowerCase();if(m=="div"&&(n=t.getAttribute("recid"))!=null){u=t;break}if(!s&&m=="td"){o=t;s=t.getAttribute("colid")}t=t.parentNode}}catch(q){}return u?{row:u,col:o,id:n,col_id:s}:null}j._sel_onChange=function(o,m){var n=this.getRowElement(o);if(n){k(n,m,"DlDataGridRow-selected")}};j._sel_onReset=function(m,n){var o,p;for(o in m){if(!n[o]){p=this.getRowElement(o);if(p){g(p,"DlDataGridRow-selected")}}}for(o in n){if(!m[o]){p=this.getRowElement(o);if(p){i(p,"DlDataGridRow-selected")}}}};j.setSelectionModel=function(m){if(this._selection){this._selection.removeEventListener(this._sel_events)}this._selection=m;m.addEventListener(this._sel_events)};j._body_onDblClick=function(m){this.callHooks("onBodyDblClick")};j._body_onMouseOver=function(n){var m=b(n);if(m&&(this.__tooltip instanceof Function)){this._tooltipRow=m;DlWidget.getTooltip().popup({timeout:this.__tooltipTimeout,content:this.__tooltip(m),anchor:this.getElement(),align:"mouse",onPopup:this.__onTooltipShow,onHide:this.__onTooltipHide,widget:this})}};j._body_onMouseOut=function(n){var m=b(n);if(m){DlWidget.getTooltip().hide();this._tooltipRow=null}};j._body_onMouseLeave=function(m){};j.__handleSelectClick=function(p,o){var q=this._selection,m=this._records;if(q.multiple){if(o.button==2){if(!this._rtClickKeepSel){if(o.ctrlKey){q.select([p.id])}else{if(!q.isSelected(p.id)){q.reset([p.id])}}}}else{if(o.ctrlKey){q.toggle(p.id);q._last=p.id}else{if(o.shiftKey){if(q._last!=null){var t=m.id_to_pos[q._last];var s=m.id_to_pos[p.id];var n=m.array.slice(Math.min(t,s),Math.max(t,s)+1);q.reset(n)}else{q.toggle(p.id);q._last=p.id}}else{q.reset([p.id]);q._last=p.id}}}}else{q.reset([p.id]);q._last=p.id}};j._body_onMouseUp=function(o){var n=b(o),m=this.__handleOnMouseUp;if(n&&m&&n.id==m.id){this.__handleSelectClick(n,o)}};j._body_onMouseDown=function(n){var m=b(n),o=this._selection;if(m){this.__handleOnMouseUp=!o.isSelected(m.id)||!this._bodyCont._dragArgs||n.ctrlKey||n.shiftKey?null:m;if(!this.__handleOnMouseUp){this.__handleSelectClick(m,n)}c()}};j.scrollToRecord=function(q,p){var s=this.getRowsContainer();var r=Math.floor(s.offsetHeight/s.childNodes.length);var t=r*this._records.id_to_pos[q||this._selection._last];var m=this.getBodyDiv(),o=m.scrollTop,n=m.clientHeight;if(p==null){if(t<o){m.scrollTop=t;this._setVScroll(r*this._info_display.first_row_index)}else{if(t+r>o+n){m.scrollTop=t+r-n;this._setVScroll(r*this._info_display.first_row_index)}}}else{switch(p){case"top":m.scrollTop=t;break;case"bottom":m.scrollTop=t+r-n;break;case"center":m.scrollTop=(2*t+r-n)/2;break}}};j.scrollHome=function(){this.getBodyDiv().scrollTop=0};j.scrollEnd=function(){this.getBodyDiv().scrollTop=this._getVSHeightDiv().offsetHeight};j.scrollPage=function(n){var m=this.getBodyDiv();m.scrollTop+=n*m.clientHeight-20};j._handle_focusKeys=function(q){var r=this._selection,n=q.keyCode,t=q.charCode,m=this._records;switch(n){case DlKeyboard.ARROW_DOWN:var o=-1;if(r._last!=null){o=m.id_to_pos[r._last]}if(q.shiftKey&&r.multiple){var p=m.array.slice(o,o+2);r.select(p);r._last=p.peek()}else{o=m.array.limitIndex(o+1);var s=m.array[o];r.reset([s]);r._last=s}this.scrollToRecord();c();break;case DlKeyboard.ARROW_UP:var o=m.array.length;if(r._last!=null){o=m.id_to_pos[r._last]}if(q.shiftKey&&r.multiple){var p=m.array.slice(o-1,o);r.select(p);r._last=p.peek()}else{o=m.array.limitIndex(o-1);var s=m.array[o];r.reset([s]);r._last=s}this.scrollToRecord();c();break;case DlKeyboard.HOME:this.scrollHome();c();break;case DlKeyboard.END:this.scrollEnd();c();break;case DlKeyboard.PAGE_UP:this.scrollPage(-1);c();break;case DlKeyboard.PAGE_DOWN:this.scrollPage(1);c();break}a.BASE._handle_focusKeys.call(this,q)};j._makeHeadLabel=function(m){return new this._headType(m)};j._onHeadClick=function(n,o){if(n.isSortable()){n=n.id();var p=this.__sortCol||null;var m=null;if(n==p){m=true;if(this.__sortRev){m=!m}}this.__sortRev=m;this._data.sort(this._records.array,n,p,m,function(q){this.resetIDS(q);this.refreshDisplay();this.setSortColumn(n,m)},this)}};j.setSortColumn=function(n,m){var o=this.__sortCol;if(o){o=this._colsById[o];o._button.delClass(/DlDataGridHeadLabel-sort-[^\s]+/g)}this.__sortCol=n;if(n){this._colsById[n]._button.condClass(m,"DlDataGridHeadLabel-sort-down","DlDataGridHeadLabel-sort-up")}};j.getSortColumn=function(){return this.__sortCol};j.getSortReverse=function(){return this.__sortRev};j.getCol=function(m){if(!(m instanceof DlGridCol)){m=this._colsById[m]}return m};j.getRec=function(m){if(!(m instanceof DlRecord)){m=this._data.get(m)}return m};j.setColWidth=function(n,m){n=this.getCol(n);n._width=m;this._ss.modifyRule(n._cssRule,{width:m+"px"})};j.setColVisible=function(n,m){n=this.getCol(n);this._ss.modifyRule(n._cssRule,{display:m?"":"none"});n._isVisible=!!m};j.getColWidth=function(m){m=this.getCol(m);return this.getHeaderRow().cells[m.index].offsetWidth};j._getDragObject=function(){if(!this.__drag){this.__drag=new DlGridDragCol({})}return this.__drag};j._fetchRowContentHTML=function(o,r){o("<table class='DlDataGrid-rowTable' cellspacing='0' cellpadding='0'><tr>");var u=this._cols,p=u.length,t=this._data,q,m,v,s;for(s=0;s<p;++s){q=u[s];m=q.id();o("<td colid='",m,"' class='DlDataGrid-col-",m);v=t.getCellClass(r,q.id());if(v){o(" ",v)}o("'>");if(is_ie){o("<div class='DlDataGrid-cellData'>")}t.formatHTML(r,q.id(),o);if(is_ie){o("</div>")}o("</td>")}o("</tr></table>")};j._fetchRowHTML=function(n,p){var m="DlDataGrid-row",o=this._data.getRecClass(p);if(o){m+=" "+o}if(this.rec_isSelected(p)){m+=" DlDataGridRow-selected"}n("<div id='",this.id,":",p.id(),"' class='",m,"' recid='",p.id(),"'>");this._fetchRowContentHTML(n,p);n("</div>")};j.getRowElement=function(m){return document.getElementById(this.id+":"+m)};j.refreshDisplay=function(){this._oldScroll=null;var r=this.getBodyDiv(),u=r.scrollTop;var n=this.getRowsContainer();var t=this._records.array;var o=this._info_display;if(this._rpp&&t.length<this._rpp){this.displayPage(0)}if(this._rpp){var q=Math.floor(n.offsetHeight/n.childNodes.length);var p=Math.ceil(u/q)-1;if(p<0){p=0}var s=Math.floor((u+r.clientHeight)/q);if(s>=t.length){s=t.length-1}var m=t.slice(p,p+this._rpp);this._display_ids(m,q*p)}};j.__doLayout=function(){var n=this.getInnerSize();var m=this.getBodyDiv();var o=this.getHeaderDiv();l.setOuterSize(m,n.x,n.y-o.offsetHeight);l.setOuterSize(o,n.x,null);this._resetVSHeight();if(this._records&&this._records.array.length>0){this._oldScroll=null;d.call(this)}this._recompDynamicWidths()};j.getBoundRecords=function(){var m=this.getBodyDiv(),p=m.scrollTop;var s=this.getRowsContainer();var n=this._records.array;var o=s.offsetHeight;if(o==0){return this.__boundRecords}var q=Math.floor(o/s.childNodes.length);var t=Math.ceil(p/q)-1;if(t<0){t=0}var r=Math.floor((p+m.clientHeight)/q);if(r>=n.length){r=n.length-1}return this.__boundRecords={first:t,last:r,count:r-t+1,h:q}};function d(){if(this._processing_scroll){return}this._processing_scroll=true;var r=this.getBodyDiv(),u=r.scrollTop;this.getHeaderTable().style.marginLeft=-r.scrollLeft+"px";if(this._vScroll&&this._records&&u!=this._oldScroll){var n=this.getRowsContainer();var t=this._records.array;var o=this._info_display;var q=this.getBoundRecords();var p=q.first;var s=q.last;q=q.h;if(p>=o.first_row_index&&s<=o.last_row_index){}else{if(s<o.first_row_index||p>o.last_row_index){var m=t.slice(p,p+this._rpp);this._display_ids(m,q*p)}else{if(p<o.first_row_index){var m=t.slice(p,o.first_row_index);this.__scrollConts++;this.__cont=function(z){var x=String.buffer("<div>"),y=z.length;z.foreach(this._fetchRowHTML.$(this,x));x("</div>");var A=x.get();var w=l.createFromHtml(A),D;try{var v=document.createRange(),C=n.childNodes;v.selectNodeContents(w);D=v.extractContents();v.detach();v=document.createRange();v.setStartBefore(C[C.length-y]);v.setEndAfter(C[C.length-1]);v.deleteContents()}catch(B){if(!D){D=document.createDocumentFragment()}while(w.firstChild){n.removeChild(n.lastChild);D.appendChild(w.firstChild)}}n.insertBefore(D,n.firstChild);this._setVScroll(q*p);o.first_row_index=p;o.last_row_index-=y};this._fetch_data(m,-1,function(v){this.__scrollConts--;if(this.__scrollConts==0){this.__cont(v)}})}else{if(s>o.last_row_index){var m=t.slice(o.last_row_index+1,s+1);this.__scrollConts++;this.__cont=function(v){var w=String.buffer("<div>"),C=v.length;v.foreach(this._fetchRowHTML.$(this,w));w("</div>");var y=w.get();var B=l.createFromHtml(y),A;try{var z=document.createRange();z.selectNodeContents(B);A=z.extractContents();z.detach();z=document.createRange();z.setStartBefore(n.firstChild);z.setEndBefore(n.childNodes[C]);z.deleteContents()}catch(x){if(!A){A=document.createDocumentFragment()}while(B.firstChild){n.removeChild(n.firstChild);A.appendChild(B.firstChild)}}n.appendChild(A);this._setVScroll(this._getVSScrollDiv().offsetHeight+(q*C));o.first_row_index+=C;o.last_row_index=s};this._fetch_data(m,1,function(v){this.__scrollConts--;if(this.__scrollConts==0){this.__cont(v)}})}}}}this._oldScroll=u}this.callHooks("onBodyScroll");this._processing_scroll=false}});DEFINE_CLASS("DlDragDataGrid",DlDrag,function(b,a){a.startOK=function(c,g){var d=c.parent,i=false,f=g.target;while(f&&f!=c.getElement()){if(f==d._getVSHeightDiv()){i=true;break}f=f.parentNode}if(i&&d._selection.getArray().length>0){this.grid=d}else{i=false}return i};a.reset=function(){this.grid=null;b.BASE.reset.apply(this,arguments)}});DEFINE_CLASS("DlDesktop",DlContainer,function(d,c){d.DEFAULT_ARGS={_bounds:["bounds",new DlRect(50,30,800,600)]};c._createElement=function(){d.BASE._createElement.call(this);var f=this.getElement();this._bounds.positionDiv(f);document.body.appendChild(f)};if(is_ie){var a=Dynarch.ID("IEsux"),b=function(){var f=document.getElementById(a);if(!f){f=document.createElement("div");f.style.position="absolute";f.style.right=f.style.bottom=f.style.width=f.style.height="0px";f.style.zIndex="-100";document.body.appendChild(f)}this.setSize({x:f.offsetLeft,y:f.offsetTop+f.offsetHeight})}}c.fullScreen=function(){var g=this.getElement().style;g.top="0px";g.left="0px";g.width="100%";g.height="100%";var f;if(!is_ie){f=this.callHooks.$(this,"onResize")}else{f=b.$(this)}DynarchDomUtils.addEvent(window,"resize",f.clearingTimeout(25))}});DEFINE_CLASS("DlTable",DlContainer,function(c,b,a){var d=a.createElement;c.FIXARGS=function(f){f.tagName="table";this._colSpan=0};c.DEFAULT_ARGS={__cellSpacing:["cellSpacing",null],__cellPadding:["cellPadding",null],__align:["align",null]};b._createElement=function(){c.BASE._createElement.call(this);var f=this.getElement();if(this.__cellPadding!=null){f.cellPadding=this.__cellPadding}if(this.__cellSpacing!=null){f.cellSpacing=this.__cellSpacing}if(this.__align!=null){f.align=this.__align}d("tbody",null,null,f)};b.getContentElement=function(){return this.getElement().firstChild};b.addRow=function(){return new DlTableRow({parent:this})};b.getRow=function(f){return this.children(f)};b.addCell=function(k,l,i){var f=new DlTableCell({parent:k});if(l!=null){f.addClass("DlAlign-"+l)}if(i!=null){var j=f.getElement().style;j.verticalAlign=i}var g=f.getElement().cellIndex+1;if(g>this._colSpan){this._colSpan=g}return f};b.getColSpan=function(){return this._colSpan};b.setColSpan=function(f){this._colSpan=f};b.addSeparator=function(f){if(f==null){f=this.getColSpan()}d("div",null,{innerHTML:"&nbsp;"},d("td",null,{colSpan:f},d("tr",null,{className:"DlTable-RowSeparator"},this.getContentElement())))}});DEFINE_CLASS("DlTableRow",DlContainer,function(b,a){b.DEFAULT_ARGS={_tagName:["tagName","tr"]}});DEFINE_CLASS("DlTableCell",DlContainer,function(b,a){b.DEFAULT_ARGS={_tagName:["tagName","td"]}});DEFINE_CLASS("DlFieldGrid",DlTable,function(b,a){b.CONSTRUCT=function(){this.__fields={}};a.addField=function(l,c,k){var n=l.widget||new DlEntry(l);var m=l.label;if(!c){c={}}if(m){if(!(m instanceof DlWidget)){m=new DlLabel({label:l.label.makeLabel(),widget:n})}else{if(m instanceof DlLabel){m.setWidget(n)}}}var o=this.addRow();var i=this.addCell(o,"right",l.valign);i.addClass("DlFieldGrid-labelCell");if(l.valign=="top"&&(m instanceof DlLabel)){i.getElement().style.paddingTop="4px"}if(m){i.appendWidget(m)}if(c.middleText){var j=this.addCell(o);j.setContent(c.middleText)}var g=this.addCell(o);g.appendWidget(n);var d=l.id||l.name;if(d!=null){this.__fields[d]=n.getWidgetId();delete l.id}if(c){var f=g.getElement();if(c.colSpan){f.colSpan=c.colSpan}if(c.rowSpan){f.rowSpan=c.rowSpan}}if(k){k.row=o;k.c1=i;k.c2=g;k.label=m;k.entry=n}return n};a.getField=function(c){return c?DlWidget.getById(this.__fields[c]):this.__fields};a.setField=function(c,d){this.__fields[c]=d.getWidgetId()};a.getValue=function(){var j={};for(var g in this.__fields){var c=this.getField(g),i=c.getFormValue||c.getValue;if(i instanceof Function){if(c instanceof DlAbstractButton&&c._checkTwoState(true)){var d=i.call(c);if(d==null){j[g]=c.checked()}else{if(c.checked()){j[g]=d}}}else{j[g]=i.call(c)}}}return j};a.getValues=a.getValue;a.setValue=function(j){for(var g in j){var c=this.getField(g),d=j[g],i;if(c){i=c.setFormValue||c.setValue;if(i instanceof Function){if(c instanceof DlAbstractButton&&c._checkTwoState(true)){c.checked(typeof d=="string"?d!="0":!!d)}else{i.call(c,d)}}}}};a.setValues=a.setValue});DEFINE_CLASS("DlFieldset",DlContainer,function(c,b,a){c.DEFAULT_ARGS={_label:["label","DlFieldset"]};b._createElement=function(){c.BASE._createElement.call(this);this.getElement().innerHTML=["<span class='DlFieldset-label'>",this._label,"</span>","<div class='DlFieldset-content'></div>"].join("")};b.getContentElement=function(){return this.getElement().childNodes[1]};b.getLabelElement=function(){return this.getElement().firstChild};b.setOuterSize=b.setSize=function(g){var i=a.getPos(this.getLabelElement()),f=a.getPos(this.getContentElement()),d=f.y-i.y;a.setOuterSize(this.getElement(),g.x,g.y-d);g=a.getInnerSize(this.getElement());a.setOuterSize(this.getContentElement(),g.x,g.y);this.callHooks("onResize")}});(function(){var b={},a={};window.DlSingleton={get:function(d,c){return a[d]||!c&&(a[d]=new b[d]())},register:function(c,d,f){b[c]=d;if(f){window[c]=this.get.$C(c)}}}})();DEFINE_SINGLETON("DlFlashUtils",DlEventProxy,function(i,g){i.DEFAULT_EVENTS=["onLoad","onStorageStatus"];var j=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" />');var f=null;window.DlFlashUtils_init=function(k){DlFlashUtils().callHooks("onLoad")};g.init=function(){if(!f){var k=j({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;'>"+k+"</div>");f=document.getElementById("DlFlashUtils-MOVIE")}};g.getObject=function(){return f};g.display=function(k){f.parentNode.style.left=k?"50%":"-256px"};function d(m){var k=null;try{k=m.GetVariable("$version")}catch(l){}return k}var c={"ShockwaveFlash.ShockwaveFlash.7":d,"ShockwaveFlash.ShockwaveFlash.6":function(m){var k="Win 6,0,21";try{m.AllowScriptAccess="always";k=d(m)}catch(l){}return k},"ShockwaveFlash.ShockwaveFlash":d};g.isSupported=function(){var o=navigator.plugins;if(o&&o.length){o=o["Shockwave Flash"];if(o&&o.description&&/^Shockwave Flash\s+([^\s]+)/i.test(o.description)){return parseFloat(RegExp.$1)>=8}}else{if(is_ie){for(var m in c){try{var n=new ActiveXObject(m);if(n){var k=c[m](n);if(k!=null){k=k.split(/\s+/)[1];return parseFloat(k)>=8}}}catch(l){}}}}return false};g.loadPolicyFile=function(k){return this.getObject().DlSocket_loadPolicyFile(k)};var b=g.decodeString=function(k){return k.replace(/%22/g,'"').replace(/%5c/g,"\\").replace(/%26/g,"&").replace(/%25/g,"%")};var a=g.decodeObject=function(m){var l,k;if(m instanceof Array){for(l=m.length;--l>=0;){m[l]=a(m[l])}}else{if(typeof m=="object"){if(m==null){return m}k={};for(l in m){k[b(l)]=a(m[l])}m=k}else{if(typeof m=="string"){m=b(m)}}}return m}});DlFlashStore={set:function(a,b){DlFlashUtils().getObject().DlStorage_set(a,b)},get:function(a){return DlFlashUtils().decodeObject(DlFlashUtils().getObject().DlStorage_get(a))},getAllKeys:function(){return DlFlashUtils().decodeObject(DlFlashUtils().getObject().DlStorage_getAllKeys())},remove:function(a){DlFlashUtils().getObject().DlStorage_remove(a)},clear:function(){DlFlashUtils().getObject().DlStorage_clear()},flush:function(a){var b=DlFlashUtils().getObject().DlStorage_flush();if(a&&b=="pending"){DlFlashUtils().display(true)}return b},_onStatus:function(a){DlFlashUtils().display(false);DlFlashUtils().applyHooks("onStorageStatus",[a])}};DEFINE_CLASS("DlGridLayout",DlLayout,function(f,d,b){var g=b.createElement,c=b.addClass;f.DEFAULT_ARGS={__layout:["layout",null],__layoutHTML:["layoutHTML",null],__cellSpacing:["cellSpacing",0],__cellPadding:["cellPadding",1]};var a=["width","padding","paddingLeft","paddingRight","paddingTop","paddingBottom","verticalAlign","textAlign","whiteSpace"];d._createElement=function(){f.BASE._createElement.call(this);var i;if(!this.__layoutHTML){i=g("table",null,{cellSpacing:this.__cellSpacing,cellPadding:this.__cellPadding,className:"DlGridLayout-table"});g("tbody",null,null,i);var j=this.__layout;j.foreach(function(m){var l=m.props;var k=i.insertRow(-1);if(l&&l.minHeight){c(k,"DlGridLayout-tr-minHeight");k.minHeight=true}m.cells.foreach(function(n,o){var p=k.insertCell(-1);if(o==0&&l&&l.height){p.style.height=l.height}if(n){if(n.colSpan){p.colSpan=n.colSpan}if(n.className){p.className=n.className}if(n.rowSpan){p.rowSpan=n.rowSpan}if(n.minWidth){c(p,"DlGridLayout-td-minWidth")}if(n.minHeight){p.minHeight=true;c(p,"DlGridLayout-td-minHeight")}a.r_foreach(function(r){var q=n[r];if(q!=null){this[r]=q}},p.style)}})});this.getElement().appendChild(i)}else{this.setContent(this.__layoutHTML);i=this.getElement().getElementsByTagName("table")[0]}this.refNode("__table",i)};d._appendWidgetElement=function(i,k){if(k.inCell){var j=this.getCellElement(k.row,k.col);j.appendChild(i.getElement());i._dllayout_args=k}else{f.BASE._appendWidgetElement.call(this,i,k)}};d._removeWidgetElement=function(i){if(this._widgets.contains(i)){if(!i._dllayout_args.inCell){f.BASE._removeWidgetElement.call(this,i)}else{var j=i.getElement();j.parentNode.removeChild(j)}}};d.getTableElement=function(){return this.__table};d.getCellElement=function(j,i){return this.getTableElement().rows[j].cells[i]};d.doLayout=function(){var i=this.children();(2).times(function(j){i.foreach(function(s){var o=s._dllayout_args;if(!o.inCell){var l=this.getCellElement(o.row,o.col);var q=l.offsetLeft,p=l.offsetTop;var r=l.offsetWidth,m=l.offsetHeight;if(j==0){var n=s.getOuterSize();if((l.minHeight||l.parentNode.minHeight)&&m<n.y){l.style.height=n.y+"px"}}else{var k=s.getElement().parentNode.style;k.left=q+"px";k.top=p+"px";s.setOuterSize({x:r,y:m})}}},this)},this)};d.showWidgets=function(i){if(arguments.length==0){i=true}this.children().r_foreach(function(j){j.display(i)})}});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(a){return a&&a.nodeType==1&&(a.tagName.toLowerCase() in DlHtmlUtils._blockTags)},needsClosingTag:function(a){return a&&a.nodeType==1&&!(a.tagName.toLowerCase() in DlHtmlUtils._quickTags)},htmlEncode:function(a){return String(a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\x22/g,"&quot;").replace(/\u00A0/g,"&#xa0;")},getHTML:function(n,b,g){var a=DlHtmlUtils;var j=[];var d=0;var p=a.needsClosingTag;var k=a.htmlEncode;var s=a.getInnerText;var o=null;var r=null;var c=null;var q=a._descTags;var i=a._headingTags;var m=0;function f(x,t){switch(x.nodeType){case 11:t=false;case 1:var B=x.tagName.toLowerCase();if(x.className=="DynarchLIB-REMOVE-ME"){break}if(t){var w=!(x.hasChildNodes()||p(x));if(B=="br"){if(x.previousSibling&&!x.nextSibling){break}if(m){j[d++]="\n";break}}if(g){if(o==null&&B in i){o=s(x);c=0}else{if(r==null&&B in q){r=s(x)}}}j[d++]="<";j[d++]=B;var A=x.attributes;for(var v=0;v<A.length;++v){var y=A.item(v);if(!y.specified){continue}var u=y.nodeName.toLowerCase();if(/^_moz|^_msh/.test(u)){continue}var z;if(u!="style"){if(typeof x[y.nodeName]!="undefined"&&u!="href"&&u!="src"&&!/^on/.test(u)){z=x[y.nodeName]}else{z=y.nodeValue}}else{z=x.style.cssText}if(/(_moz|^$)/.test(z)){continue}j[d++]=" "+u+'="'+k(z)+'"'}j[d++]=w?" />":">"}if(B=="pre"){++m}for(v=x.firstChild;v;v=v.nextSibling){f(v,true)}if(B=="pre"){--m}if(t&&!w){j[d++]="</"+B+">"}if(c===0){c=d}break;case 3:if(/^(script|style)$/i.test(x.parentNode.tagName)){if(x.data.indexOf("/*<![CDATA[*/")!=0){j[d++]="/*<![CDATA[*/";j[d++]=x.data;j[d++]="/*]]>*/"}else{j[d++]=x.data}}else{j[d++]=x.data.htmlEscape()}break;case 4:case 8:j[d++]="<!--";j[d++]=x.data;j[d++]="-->";break}}f(n,b);var l=j.join("");if(g){l={title:o,description:r,content:l,contentButTitle:""};if(c){l.contentButTitle=j.slice(c).join("")}}return l},getInnerText:function(a){if(a.innerText!=null){return a.innerText}if(a.textContent!=null){return a.textContent}},getText:function(k){var g=k.cloneNode(true);var c=g.getElementsByTagName("*");for(var f=c.length;--f>=0;){var j=c[f];if(DlHtmlUtils.isBlockElement(j)){var d=j.ownerDocument.createTextNode(" ");j.insertBefore(d,j.firstChild);j.appendChild(d.cloneNode(true))}}var b=DlHtmlUtils.getInnerText(g);DynarchDomUtils.trash(g);return b},_can_t_DeleteFull_tags:"td".hashWords(),canDeleteFullNode:function(a){return !(a.toLowerCase() in DlHtmlUtils._can_t_DeleteFull_tags)},_can_t_DeleteContent_tags:"ul ol dd table tr img br hr".hashWords(),canDeleteContent:function(a){return !(a.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(a){return !(a.toLowerCase() in DlHtmlUtils._can_t_StripNode_tags)}};DEFINE_CLASS("DlIconListView",DlContainer);DEFINE_CLASS("DlIconListItem",DlAbstractButton,function(c,b){c.DEFAULT_ARGS={__itemSize:["itemSize",{x:100,y:null}],__itemSpacing:["itemSpacing",0],__spaceEvenly:["spaceEvenly",false],__iconSize:["iconSize",{x:40,y:40}],__iconAbove:["iconAbove",true],_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 a=["DlIconListItem-iconCell","DlIconListItem-labelCell"];b._createElement=function(){DlWidget.prototype._createElement.call(this);var d=this.getElement();d.cellSpacing=d.cellPadding=0;if(this.__spaceEvenly){d.style.margin=this.__itemSpacing+"px"}else{d.style.marginRight=d.style.marginBottom=this.__itemSpacing+"px"}d.insertRow(-1).insertCell(-1);d.insertRow(-1).insertCell(-1);d.align="left";this.setIconAbove(this.__iconAbove,true);this.setIconClass(this._iconClass);this.label(this._label,true);this.setIconSize(this.__iconSize);this._updateState()};b.setIconClass=function(d){this.getIconCell().className=a[0]+" "+d};b.getIconCell=function(){return this.getElement().rows[this.__iconAbove?0:1].cells[0]};b.getLabelCell=function(){return this.getElement().rows[this.__iconAbove?1:0].cells[0]};b.setIconSize=function(d){DynarchDomUtils.setInnerSize(this.getIconCell(),d.x,d.y);this.__iconSize=d};b.getIconSize=function(){return this.__iconSize};b.setIconAbove=function(d,g){var f=this.getElement().rows;if(g){f[0].cells[0].className=a[d?0:1];f[1].cells[0].className=a[d?1:0]}else{if(d!==this.__iconAbove){f[1].parentNode.insertBefore(f[1],f[0])}}this.__iconAbove=d};b.label=function(d,f){if(d!=null&&(f||d!==this._label)){this._label=d;this.getLabelCell().innerHTML=String.buffer("<div class='DlIconListItem-labelDiv' style='width:",this.__itemSize.x,"px'>",d,"</div>").get();this.applyHooks("onUpdateLabel",[this._label])}return this._label}});DlJSON={RE_strings:/(\x22(\\.|[^\x22\\])*\x22|\x27(\\.|[^\x27\\])*\x27)/g,RE_forbid:/([\n;()+=\x2f*.-])/g,encode:function(c){var b,a;if(c instanceof Array){b=["[",c.map(DlJSON.encode).join(","),"]"].join("")}else{if(c instanceof Date){b=DlJSON.encode(c.toUTCString())}else{if(c==null){b="null"}else{if(typeof c=="object"){b=[];for(a in c){b.push([DlJSON.encode(a),":",DlJSON.encode(c[a])].join(""))}b=["{",b.join(","),"}"].join("")}else{if(typeof c=="string"){b=['"',c.replace(/\x5c/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\x22/g,'\\"'),'"'].join("")}else{b=c.toString()}}}}}return b},decode:function(str,safe){str=str.trim();if(!safe){var tmp=str.replace(DlJSON.RE_strings,"");if(DlJSON.RE_forbid.test(tmp)){throw new DlSecurityException("Character "+RegExp.$1+" not allowed in JSON input!")}}try{var val;eval(["val=",str].join(""));return val}catch(ex){throw new DlDataException("Malformed data in JSON input: "+ex)}},domToObject:function(c){var d={};var g=String.buffer();for(var b=c.firstChild;b;b=b.nextSibling){if(b.nodeType==1){var f=DlJSON.domToObject(b),a=b.nodeName;if(!(a in d)){d[a]=f}else{if(!(d[a] instanceof Array)){d[a]=[d[a]]}d[a].push(f)}}else{if(b.nodeType==3){g(b.nodeValue)}}}d.$text=g.get();return d}};var DlKeyboard={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(c){var b={},a;c=c.toUpperCase();if((a=/^([a-z]+)\s+\x27(.)\x27$/i.exec(c))){b[a[1]]=true;b.key=a[2]}else{if((a=/^([a-z]+)-([a-z]+)\s+\x27(.)\x27$/i.exec(c))){b[a[1]]=b[a[2]]=true;b.key=a[3]}else{if((a=/^([a-z]+)-([a-z]+)-([a-z]+)\s+\x27(.)\x27$/i.exec(c))){b[a[1]]=b[a[2]]=b[a[3]]=true;b.key=a[4]}}}return b},checkKey:function(b,a){if(typeof a=="string"){a=DlKeyboard.parseKey(a)}return(((!a.CTRL&&!b.ctrlKey)||(a.CTRL&&b.ctrlKey))&&((!a.ALT&&!b.altKey)||(a.ALT&&b.altKey))&&((!a.SHIFT&&!b.shiftKey)||(a.SHIFT&&b.shiftKey))&&b.keyStr.toUpperCase()==a.key.toUpperCase())}};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(true);DlKeyboard.KEYS_MOVE=["ARROW_LEFT","ARROW_UP","ARROW_RIGHT","ARROW_DOWN"].keys_map(DlKeyboard).toHash(true);DlKeyboard.KEYS_MOVE_PREV=["ARROW_LEFT","ARROW_UP"].keys_map(DlKeyboard).toHash(true);DEFINE_CLASS("DlLabel",DlAbstractButton,function(b,a){b.DEFAULT_ARGS={_activateWidget:["widget",null],_tagName:["tagName","span"]};a._onMouseDown=function(d){var c=this._activateWidget;if(c){c.focus();d.domStop=true;DlException.stopEventBubbling()}};a.setWidget=function(c){this._activateWidget=c};a.getWidget=function(){return this._activateWidget};a._handle_accessKey=function(c){this._onMouseDown(c)}});DEFINE_CLASS("DlMacBarIcon",DlAbstractButton,function(f,d){f.BEFORE_BASE=function(){this.__currentWidth=this.__minWidth;this.__currentHeight=this.__minHeight;this.__align=this.__align.split(/\s+/).toHash()};var g={active:"DlMacBarIcon-active",hover:"DlMacBarIcon-hover",checked:"DlMacBarIcon-1",unchecked:"DlMacBarIcon-0",empty:"DlMacBarIcon-empty",disabled:"DlMacBarIcon-disabled"};f.DEFAULT_ARGS={_classes:["classes",g],__image:["img",null],__minWidth:["minWidth",32],__minHeight:["minHeight",32],__maxWidth:["maxWidth",64],__maxHeight:["maxHeight",64],__align:["align","bottom"],__tooltipTimeout:["tooltipTimeout",900]};d._createElement=function(){DlWidget.prototype._createElement.call(this);this.setContent(String.buffer("<img src='",this.__image,"' width='",this.__minWidth,"' height='",this.__minHeight," ' />").get())};d.getImgElement=function(){return this.getElement().firstChild};d.flash=function(i){this._onMouseEnter();this._onMouseLeave.delayed(i||100,this)};d.initDOM=function(){f.BASE.initDOM.call(this);this.addEventListener({onDestroy:c});this.__anim=new DlAnimation(25,40);this.__anim.addEventListener({onUpdate:a.$(this),onStart:b.$(this)})};function c(){this.__anim.destroy()}d._onMouseEnter=function(){f.BASE._onMouseEnter.apply(this,arguments);var i=this.__anim;i.ew=this.__maxWidth;i.eh=this.__maxHeight;i.start(30,50,DlAnimation.easing.elastic_b)};d._onMouseLeave=function(){f.BASE._onMouseLeave.apply(this,arguments);var i=this.__anim;i.ew=this.__minWidth;i.eh=this.__minHeight;i.start(50,50,DlAnimation.easing.accel_b)};function b(){this.__anim.sw=this.__currentWidth;this.__anim.sh=this.__currentHeight}function a(){var i=this.__anim,k=this.getImgElement(),m=i.getPos(),j;var l=i.getPos(function(n){return 1-Math.cos(n*2.5*Math.PI)/Math.exp(5*n)});k.width=this.__currentWidth=m.mapInt(i.sw,i.ew);k.height=this.__currentHeight=l.mapInt(i.sh,i.eh);i=this.__align;j=this.__minWidth-this.__currentWidth;if(i.center){j/=2}if(i.left||i.center){k.style.marginRight=j+"px"}if(i.right||i.center){k.style.marginLeft=j+"px"}j=this.__minHeight-this.__currentHeight;if(i.middle){j/=2}if(i.top||i.middle){k.style.marginBottom=j+"px"}if(i.bottom||i.middle){k.style.marginTop=j+"px"}}});DEFINE_CLASS("DlNotebook",DlContainer,function(c,b){c.CONSTRUCT=function(){this._panes=[];this._currentPane=null};var a=["onChange"];b._createElement=function(){c.BASE._createElement.call(this);this.getElement().innerHTML="<div class='TabContent-inner'></div>"};b.appendWidget=function(f,i){f.registerEvents(["onNotebookShow"]);c.BASE.appendWidget.call(this,f);var g=f.getElement();var d=this.getContentElement();if(i!=null){i=this.__widgetsPosition}else{this.__widgetsPosition=i}if(i==null){i=this.__widgetsPosition=DynarchDomUtils.getPadding(d).x/2}g.style.position="absolute";g.style.visibility="hidden";g.style.left=g.style.top=i+"px";d.appendChild(g);this._panes.push(f)};b.initDOM=function(){this.registerEvents(a);c.BASE.initDOM.call(this)};b.getPane=function(d){return this._panes[d]};b.getAllPanes=function(){return this._panes};b.getCurrentPane=function(){return this.getPane(this._currentPane)};b.getCurrentPaneIndex=function(){return this._currentPane};b.length=function(){return this._panes.length};b.showPane=function(f){var d=this._currentPane;if(d!=null){this.getPane(d).visibility(false);this.getPane(d).setPos({x:-30000,y:-30000})}this._currentPane=f;var g=this.getPane(f);if(!g._dl_notebook_has_size){g.setSize(this.getInnerSize());g._dl_notebook_has_size=true}g.setPos(this.__widgetsPosition,this.__widgetsPosition);g.visibility(true);if(f!==d){this.applyHooks("onChange",[f,d])}g.callHooks("onNotebookShow");return this};b.firstPane=function(){this.showPane(0)};b.lastPane=function(){this.showPane(this.length()-1)};b.nextPane=function(){var d=this._currentPane;d==null?d=0:++d;if(d>=this._panes.length){d=0}return this.showPane(d)};b.prevPane=function(){var d=this._currentPane;d==null?d=this._panes.length-1:--d;if(d<0){d=this._panes.length-1}return this.showPane(d)};b.isFirstPane=function(){return this._currentPane==0};b.isLastPane=function(){return this._currentPane==this._panes.length-1};b.getContentElement=function(){return this.getElement().firstChild};b.setSize=b.setOuterSize=function(d){c.BASE.setOuterSize.call(this,d);var f=this.getElement();d=DynarchDomUtils.getInnerSize(f);DynarchDomUtils.setOuterSize(this.getContentElement(),d.x,d.y);f.style.width=f.style.height="";d=DynarchDomUtils.getInnerSize(this.getContentElement());var g=this.getCurrentPane();this._panes.foreach(function(i){i._dl_notebook_has_size=false});g.setSize(d);g._dl_notebook_has_size=true};b.setIdealSize=function(){var d={x:0,y:0};this._panes.r_foreach(function(g){var f=g.getOuterSize();if(f.x>d.x){d.x=f.x}if(f.y>d.y){d.y=f.y}});this.setInnerSize(d)}});DEFINE_CLASS("DlProgressBar",DlWidget,function(b,a){var c=DynarchDomUtils.createElement;b.DEFAULT_ARGS={__progress_minVal:["min",0],__progress_maxVal:["max",100],__progress_val:["val",0],__label:["label",null]};a._createElement=function(){b.BASE._createElement.call(this);var d=this.getElement();c("div",null,{className:"DlProgressBar-fill"},d);c("div",null,{className:"DlProgressBar-label",innerHTML:"&nbsp;"},d);this.setLabel(this.__label);this.setValue(this.__progress_val)};a._getLabelElement=function(){return this.getElement().lastChild};a._getFillElement=function(){return this.getElement().firstChild};a.getValue=function(){return this.__progress_val};a.getMaxVal=function(){return this.__progress_maxVal};a.getMinVal=function(){return this.__progress_minVal};a.setValue=function(g){this.__progress_val=g;if(g>this.__progress_maxVal){g=this.__progress_maxVal}var f=this.__progress_maxVal-this.__progress_minVal;var i=g-this.__progress_minVal;var d=100*i/f;if(!isNaN(d)&&d>=0){this._getFillElement().style.width=d+"%";this._updateLabel(d)}};a.setLabel=function(d){this.__label=d;this._updateLabel()};a._updateLabel=function(f){var d=this.__label;if(f==null){f=0}if(d!=null){if(typeof d=="function"){d=d(this,f,this.__progress_val)}else{d=d.replace(/%d/g,Math.round(f)).replace(/%f/g,f.toFixed(2)).replace(/%v/g,this.__progress_val)}if(!/\S/.test(d)){d="&nbsp;"}this._getLabelElement().innerHTML=d}};a.reset=function(g,d,i,f){if(i==null){i=g}this.__progress_minVal=g;this.__progress_maxVal=d;if(arguments.length>3){this.__label=f}this.setValue(i)}});DEFINE_CLASS("DlRadioButton",DlCheckbox,function(b,a){b.FIXARGS=function(c){c.alwaysCheck=true};b.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"}]};a.FINISH_OBJECT_DEF=function(){b.BASE.FINISH_OBJECT_DEF.call(this);this._className.remove("DlCheckbox")}});DEFINE_CLASS("DlRadioSelect",DlButtonMenu,function(c,b){c.DEFAULT_ARGS={_options:["options",[]],_value:["value",null],_connected:["connected",true]};c.DEFAULT_EVENTS=["onChange"];c.CONSTRUCT=function(){this._radioGroup=DlRadioGroup.get();if(this._options.length){this.setOptions(this._options)}this.value(this._value,true);this.addEventListener("onDestroy",function(){this._radioGroup.reset()})};b.value=function(i,g,f){var d=this._value;if(g||typeof i!="undefined"&&i!==d){this._value=i;this._updateLabel();if(!f){this.applyHooks("onChange",[d,i])}}return d};b.getValue=function(){return this.value()};b.setValue=b.value;function a(d){if(d.checked()){this.value(d.userData);DlPopup.clearAllPopups()}d._onMouseLeave()}b._updateLabel=function(){var f=null,d=this._options,g,j;for(g=d.length;--g>=0;){j=d[g];if(j==null){continue}if(this._value==j.value){this.getButton().label(j.label);j.widget.checked(true,true)}else{j.widget.checked(false,true)}}};b.setOptions=function(f){var k=this._radioGroup,l,d;k.reset();k.addEventListener("onChange",a.$(this));l=new DlVMenu({className:"DlSelect-menu"});d={parent:l,group:k,noCapture:true};f.foreach(function(m){if(m==null){l.addSeparator()}else{d.label=m.label;d.data=m.value;d.className=m.className;var g=m.widget=new DlRadioButton(d);g.connectEvents("onMouseUp","onClick")}},this);var j=l.getElement();j.style.position="absolute";l.zIndex(-100);document.body.appendChild(j);var i=l.getOuterSize().x;document.body.removeChild(j);l.zIndex("");j.style.position="";(function(){this.getButton().setOuterSize({x:i-this.getArrow().getOuterSize().x+2})}).$(this).delayed(10);this.setMenu(l);this._options=f};b.addOption=function(f,d){if(d==null){d=this._options.length}var g=f.widget=new DlRadioButton({parent:this._menu,group:this._radioGroup,noCapture:true,label:f.label,data:f.value,className:f.className});g.connectEvents("onMouseUp","onClick");this._options.splice(d,0,f);return g}});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(b,a){b.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(b,a){b.CONSTRUCT=function(){if(this.method==null){this.method=this.data!=null?"POST":"GET"}this._timeoutID=0};b.DEFAULT_EVENTS=["onStart","onStop","onTimeout"];b.DEFAULT_ARGS={url:["url",null],args:["args",null],callback:["callback",null],method:["method",null],data:["data",null],timeout:["timeout",null]};function d(i){if(i.readyState==4){delete i.onreadystatechange;this._request=null;if(this._timeoutID){clearTimeout(this._timeoutID);this._timeoutID=null}var f;try{f={success:i.status==200,status:i.status,statusText:i.statusText,timeout:false,xml:i.responseXML,text:i.responseText}}catch(g){}DlSystem().applyHooks("on-rpc-stop",[this,f,i]);this.applyHooks("onStop",[this,f,i]);if(this.callback){this.callback(f)}}}function c(f){this._request=null;f.abort();DlSystem().applyHooks("on-rpc-timeout",[this,f]);this.applyHooks("onTimeout",[this,f]);if(this.callback){this.callback({success:false,timeout:true})}}a.abort=function(){this._request.abort()};a.call=function(g){if(g!=null){Object.merge(this,g)}var m,f=false,l;if(window.XMLHttpRequest){m=new XMLHttpRequest()}else{if(window.ActiveXObject){m=new ActiveXObject("Microsoft.XMLHTTP")}else{throw"Browser does not support XMLHttpRequest"}}this._request=m;m.onreadystatechange=d.$(this,m);var k=this.args;if(k){f=[];for(l in k){f.push(escape(l)+"="+escape(k[l]))}if(f.length==0){f=false}else{f=f.join("&")}}var j=this.url;switch(this.method){case"POST":var n=this.data;if(f&&n){j+="?"+f}m.open("POST",j,true);if(!n){m.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");this._start(f)}else{if(typeof n!="string"){n=DlJSON.encode(n);m.setRequestHeader("Content-Type","text/javascript; charset=UTF-8")}this._start(n)}break;case"GET":if(f){j+="?"+f}m.open("GET",j,true);this._start(null);break}};a._start=function(f){if(this.timeout){this._timeoutID=c.delayed(this.timeout,this,this._request)}else{this._timeoutID=0}DlSystem().applyHooks("on-rpc-start",[this]);this.applyHooks("onStart",[this]);this._request.send(f)}});DEFINE_CLASS("DlRteFrame",DlWidget,function(n,d,u){var f=u.createElement,r=u.addClass,t=u.delClass,g=u.condClass,i=u.ID;var q=["mouseover","mouseout","mousemove","mousedown","mouseup","click","keydown","keyup","keypress","contextmenu"];var s=is_gecko?"<br type='_moz' />":"";var j=('<!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>'+s+"</p></body></html>");n.BEFORE_BASE=function(){this.__eventProxy=p.$(this);this.callUpdateHooks=this.callUpdateHooks.clearingTimeout(40,this)};n.CONSTRUCT=function(){if(this.__sections){this.setSections(this.__sections)}};n.DEFAULT_EVENTS=["onUpdate","onSectionChange"];n.DEFAULT_ARGS={__paragraphsMode:["useParagraphs",true],__sections:["sections",null],_focusable:["focusable",2],_tabChar:["tabChar","    "]};d.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'"}};var o="h1 h2 h3 h4 h5 h6 p pre address blockquote".hashWords();d.SEMANTIC_TAGS={bold:true,italic:true,strike:true,subscript:true,superscript:true,indent:true,underline:true,outdent:true,strikethrough:true,strike:true};d.callUpdateHooks=function(v,w){if(!this.destroyed){this.applyHooks("onUpdate",[v,w])}};d.execCommand=function(A,z){this.focus();var E;var G=this.getIframeDoc();if(is_gecko){G.execCommand("styleWithCSS",false,!(A in this.SEMANTIC_TAGS))}if(this.COMMANDS[A]){A=this.COMMANDS[A];if(typeof z=="undefined"){z=A.arg||""}A=A.id}if(A=="formatblock"){if(is_ie){var C=this.getAncestorsHash();if(C.pre){if(z=="pre"){return}var w=this.getSelection(),v=this.getRange(w);var x=this.createRange();x.moveToElementText(C.pre);v.setEndPoint("EndToEnd",x);v.select();var y,D=String.buffer("<",z,">dummy</",z,">").get();if(v.compareEndPoints("StartToStart",x)==0){C.pre.insertAdjacentHTML("beforeBegin",D);y=C.pre.previousSibling}else{var B=v.htmlText,I=v.text;v.moveStart("character",-1);if(v.text.charAt(0)!=I.charAt(0)){v.moveStart("character",1)}C.pre.insertAdjacentHTML("afterEnd","<br />");v.pasteHTML("");C.pre.parentNode.removeChild(C.pre.nextSibling);C.pre.insertAdjacentHTML("afterEnd",D);y=C.pre.nextSibling;if(/\S/.test(I)){var H=C.pre.cloneNode(true);H.innerHTML=B;y.parentNode.insertBefore(H,y.nextSibling)}}v.moveToElementText(y);v.collapse();v.select();y.innerHTML="";return}z="<"+z+">"}}switch(A){case"showHtml":try{alert(this.getHTML())}catch(F){alert("ERROR: "+F)}break;case"_nextSection":this.nextSection();break;case"_prevSection":this.prevSection();break;default:E=G.execCommand(A,false,z)}this.focus();this.callUpdateHooks();return E};d.queryCommandState=function(v){if(this.COMMANDS[v]){v=this.COMMANDS[v].id}return this.getIframeDoc().queryCommandState(v)};d.queryCommandValue=function(y){if(this.COMMANDS[y]){y=this.COMMANDS[y].id}if(!is_gecko&&/^formatblock$/i.test(y)){var w=this.getAllAncestors();for(var x=0;x<w.length;++x){var v=w[x].tagName.toLowerCase();if(v in o){return v}}}return this.getIframeDoc().queryCommandValue(y)};d.getInnerHTML=function(){return this.getIframeBody().innerHTML};d.getHTML=function(w){if(!is_ie){this.collapse(true);var x=this.getIframeDoc().createElement("span");x.id="DYNARCHLIB_RTEFRAME_CARET";this.insertNode(x)}var v=DlHtmlUtils.getHTML(this.getIframeBody(),false,w);if(!is_ie){this.deleteNode(x)}return v};d.getInnerText=function(){return DlHtmlUtils.getInnerText(this.getIframeBody())};d.getText=function(){return DlHtmlUtils.getText(this.getIframeBody())};d.setSections=function(w){this.__sections=w;var v=this.__sectionsHash={};w.foreach(function(y,x){y.index=x;v[y.name]=y;if(y.current||x==0){this.__currentSection=x;this.setHTML(y.content)}}.$(this))};d.setSectionContent=function(v,w){var x=this.getSection(v,true);x.content=w;if(x.index==this.__currentSection){this.setHTML(w)}};d.getSections=function(){var v=this.getHTML(true);Object.merge(this.getCurrentSection(),v);return this.__sectionsHash};d.getSection=function(w,v){var y=this.__sectionsHash[w];if(y.index==this.__currentSection&&!v){var x=this.getHTML(true);Object.merge(y,x)}return y};d.getCurrentSection=function(){return this.__sections[this.__currentSection]};d._setCurrentSection=function(w){var v=this.getCurrentSection();if(v!==w){var x=this.getHTML(true);Object.merge(v,x);this.__currentSection=w.index;this.setHTML(w.content);this.applyHooks("onSectionChange",[v,w])}};d.setCurrentSection=function(w){var v=this.__sectionsHash[w];this._setCurrentSection(v)};d.setCurrentSectionIndex=function(v){if(v!=this.__currentSection){var w=this.__sections[v];this._setCurrentSection(w)}};d.prevSection=function(){this.setCurrentSectionIndex(this.__sections.rotateIndex(this.__currentSection-1))};d.nextSection=function(){this.setCurrentSectionIndex(this.__sections.rotateIndex(this.__currentSection+1))};d._setListeners=function(){n.BASE._setListeners.call(this);this.addEventListener(is_ie?"onKeyDown":"onKeyPress",function(v){this._onKeypress(v)});this.addEventListener({onDestroy:c})};d._createElement=function(){n.BASE._createElement.call(this);var v=f("iframe",{display:"block"},{frameBorder:0,marginHeight:0,marginWidth:0,src:is_ie?"javascript:'';":"about:blank"},this.getElement());this.__hasFrameEvents=false;this.updateKeymap()};d.updateKeymap=function(){var v=this.__rte_keymap=[];for(var w in this.COMMANDS){var x=this.COMMANDS[w];if(x.key){v.push([DlKeyboard.parseKey(x.key),w])}}};d.setOuterSize=d.setSize=function(w){var x=u.getBorder(this.getElement());var v=u.getBorder(this.getContentElement());this.setInnerSize({x:w.x-x.x-v.x,y:w.y-x.y-v.y})};d.getIframeElement=function(){return this.getElement().firstChild};d.getContentElement=d.getIframeElement;d.getIframeWin=function(){return this.getIframeElement().contentWindow};d.getIframeDoc=function(){return this.getIframeWin().document};d.getIframeBody=function(){return this.getIframeDoc().body};d.initDesignMode=function(w){var v=this.getIframeDoc();v.open();v.write(j);v.close();v.designMode="on";if(!this.__hasFrameEvents){a.delayed(5,this,w)}};d.setHTML=function(v){if(v instanceof Array){v=v.join("")}v=v.trim();if(this.__hasFrameEvents){if(is_ie){v=v.replace(/(<pre[^>]*>)((.|\n)+?)(<\x2fpre>)/gi,function(w,A,z,y,x){z=z.replace(/\x20/g,"\xA0").replace(/\t/g,"\xA0".repeat(4));return A+z+x})}this.getIframeBody().innerHTML=v;this._onSetHTML();this.moveBOF();this.callUpdateHooks()}else{this.__pendingHTML=v}};d._onSetHTML=function(){var y=this.getIframeDoc().getElementsByTagName("pre");for(var v=y.length;--v>=0;){var w=y[v];w.innerHTML=w.innerHTML.replace(/\n/g,"<br>")}if(!is_ie){var x=this.getIframeDoc().getElementById("DYNARCHLIB_RTEFRAME_CARET");if(x){(function(A){try{this.selectNodeContents(A);this.collapse(true);this.deleteNode(A)}catch(z){}}).delayed(10,this,x)}}};d.clear=function(){this.setHTML("")};d.focus=function(){this.getIframeWin().focus();n.BASE.focus.call(this)};d.loadStyle=function(w){var y=this.getIframeDoc();var z=w.replace(/\x2f/g,"_");if(!y.getElementById(z)){var v=y.getElementsByTagName("head")[0];var x=y.createElement("link");x.type="text/css";x.rel="stylesheet";x.href=w;x.id=z;v.appendChild(x);x.disabled=true;x.disabled=false}};d.createRange=function(){return is_ie?this.getIframeBody().createTextRange():this.getIframeDoc().createRange()};d.getSelection=function(){return is_ie?this.getIframeDoc().selection:this.getIframeWin().getSelection()};d.getRange=function(v){if(v==null){v=this.getSelection()}return is_ie?v.createRange():v.getRangeAt(0)};d.getParentElement=function(){var x=this.getSelection();var v=this.getRange(x);if(is_ie){switch(x.type){case"Text":case"None":return v.parentElement();case"Control":return v.item(0);default:return null}}else{try{var y=v.commonAncestorContainer;if(!v.collapsed&&v.startContainer==v.endContainer&&v.startOffset-v.endOffset<=1&&v.startContainer.hasChildNodes()){y=v.startContainer.childNodes[v.startOffset]}while(y.nodeType==3){y=y.parentNode}return y}catch(w){return null}}};d.getAllAncestors=function(){var x=this.getParentElement();if(x&&x.nodeType==1){x=this.getParentElement()}var v=this.getIframeBody();var w=[];while(x&&x!==v&&x.nodeType==1){w.push(x);x=x.parentNode}w.push(v);return w};d.getAncestorsHash=function(){var z=this.getAllAncestors(),y,x,v,w={__all:z};z.foreach(function(A){v=A.tagName.toLowerCase();if(!w[v]){w[v]=A}});return w};d.getSelectedText=function(){var v=this.getRange();return is_ie?v.text:v.toString()};d.selectRange=function(v){if(is_ie){v.select()}else{var w=this.getSelection();w.removeAllRanges();w.addRange(v)}};d.isCollapsed=function(){var v=this.getRange();return is_w3?v.collapsed:v.compareEndPoints("StartToEnd",v)==0};d.collapse=function(v){var x=this.getSelection();var w=this.getRange(x);if(is_w3){x.removeAllRanges()}w.collapse(!!v);this.selectRange(w)};d.insertNode=function(y,v){var z=this.getSelection(),x=this.getRange(z);if(is_w3){x.deleteContents();x.insertNode(y);if(v){z.removeAllRanges();x.selectNode(y);z.addRange(x)}}else{var A=i("rteframe");x.pasteHTML(["<span id='",A,"'></span>"].join(""));var w=this.getIframeDoc().getElementById(A);w.parentNode.insertBefore(y,w);w.parentNode.removeChild(w);if(v&&y.nodeType!=3){x.moveToElementText(y);x.select()}}return y};d.insertText=function(x,v){var w=this.getIframeDoc().createTextNode(x);return this.insertNode(w,v)};d.selectNodeContents=function(w){var v=this.createRange();is_w3?v.selectNodeContents(w):v.moveToElementText(w);this.selectRange(v)};d.selectNode=function(w){if(is_w3){var v=this.createRange();v.selectNode(w);this.selectRange(v)}else{this.selectNodeContents(w)}};d.createLink=function(w,A){var y,v,z,x;if(A){this.insertText(A,true)}y="javascript:"+i("link");this.execCommand("createlink",y);v=this.getIframeDoc().getElementsByTagName("a");for(x=v.length;--x>=0;){if(v[x].href==y){z=v[x];break}}z.href=w;return z};d.createAnchor=function(v){var x=this.getSelectedText()?null:"Anchor";var w=this.createLink("#",x);w.removeAttribute("href");r(w,x?"DlAnchor-Empty":"DlAnchor");w.setAttribute("name",v);if(x){w.innerHTML=""}return w};d.getAnchors=function(){var w=this.getIframeDoc().getElementsByTagName("a"),y=w.length,v,x=[];while(--y>=0){v=w[y];if(v.name){x.unshift(v)}}return x};d.unlink=function(){this.execCommand("unlink")};d.getSelectedImage=function(){var v=this.getParentElement();if(v&&!/^img$/i.test(v.tagName)){v=null}return v};d.insertImage=function(z){var w=this.getSelectedImage();if(!w){var y="javascript:"+i("img"),v,x;this.execCommand("insertimage",y);v=this.getIframeDoc().getElementsByTagName("img");for(x=v.length;--x>=0;){if(v[x].src==y){w=v[x];break}}}w.src=z.url;if(z.width){w.width=z.width}if(z.height){w.height=z.height}if(z.align){w.align=z.align}if(z.alt){w.alt=z.alt}if(z.marginLeft){w.style.marginLeft=z.marginLeft}if(z.marginTop){w.style.marginTop=z.marginTop}if(z.marginRight){w.style.marginRight=z.marginRight}if(z.marginBottom){w.style.marginBottom=z.marginBottom}return w};d.moveBOF=function(z){var v=this.getIframeBody(),y,x;var w=z?v.lastChild:v.firstChild;if(!w){return}if(is_w3){x=this.getRange(y=this.getSelection());y.removeAllRanges();if(w.nodeType==1){x.selectNodeContents(w)}else{x.selectNode(w)}x.collapse(!z);y.addRange(x)}else{x=v.createTextRange();x.collapse(!z);x.select()}};d.moveEOF=function(v){return this.moveBOF(!v)};d.setParagraphsMode=function(v){this.__paragraphsMode=v};d.addBlockClass=function(w,y,v){var x=this.getAncestorsHash()[w];if(x){if(u.hasClass(x,y)){if(v){u.delClass(x,y);return false}}else{u.addClass(x,y)}return true}return null};d.canDeleteFullNode=function(v){return DlHtmlUtils.canDeleteFullNode(v.tagName)};d.canDeleteContent=function(v){return DlHtmlUtils.canDeleteContent(v.tagName)};d.canStripNode=function(v){return DlHtmlUtils.canStripNode(v.tagName)};d.deleteNodeContents=function(v){v.innerHTML=DlHtmlUtils.isBlockElement(v)?s:""};d.deleteNode=function(v){v.parentNode.removeChild(v)};d.stripNode=function(v){var w=v.ownerDocument.createDocumentFragment();while(v.firstChild){w.appendChild(v.firstChild)}v.parentNode.insertBefore(w,v);v.parentNode.removeChild(v);this.callUpdateHooks()};function k(v){if(v.lastChild.nodeType==1&&v.lastChild.tagName.toLowerCase()=="br"){v.removeChild(v.lastChild)}}function m(){if(!this.__paragraphsMode){return}var P=this.getAncestorsHash(),C=true,O=this.getIframeDoc();var F=this.getSelection();var L=this.getRange(F);var y=P.li||P.dd;var G=P.p;if(y){var J=this.createRange();J.selectNodeContents(y);var H;var w=/\S/.test(J.toString());if(G&&w){F.removeAllRanges();H=L.cloneRange();H.setStartBefore(G.firstChild);if(!/\S/.test(H.toString())){var v=true;var M=G.previousSibling;while(M){if(M.nodeType==1){v=false;break}M=M.previousSibling}if(v){var z=y.cloneNode(false);H.setStartBefore(y);H.insertNode(z);H.selectNodeContents(z);F.addRange(H);this.execCommand("<p>");return true}else{J.selectNodeContents(G);if(!/\S/.test(J.toString())){H=L.cloneRange();H.setStartBefore(G);H.setEndAfter(y);var K=H.extractContents();var z=K.firstChild;H.insertNode(K);H.selectNodeContents(z.firstChild||z);H.collapse(true);F.addRange(H);this.execCommand("<p>");return true}else{var D=G.cloneNode(false);H.setStartBefore(G);H.insertNode(D);H.selectNodeContents(D);F.addRange(H);this.execCommand("<p>");return true}}}H=L.cloneRange();H.setEndAfter(G.lastChild);if(!/\S/.test(H.toString())){var D=G.cloneNode(false);H.setEndAfter(G);H.collapse(false);H.insertNode(D);H.selectNodeContents(D);F.addRange(H);this.execCommand("<p>");return true}H=L.cloneRange();H.setEndAfter(G);var K=H.extractContents();H.collapse(false);var D=K.firstChild;H.insertNode(K);H.selectNodeContents(D);H.collapse(true);F.addRange(H);return true}else{if(!w){F.removeAllRanges();var A=y.parentNode;H=L.cloneRange();H.selectNode(A);H.setStartAfter(y);var K=H.extractContents();A.removeChild(y);var D=O.createElement("p");K.insertBefore(D,K.firstChild);H.setEndAfter(A);H.collapse(false);H.insertNode(K);H.selectNodeContents(D);H.collapse(true);F.addRange(H);this.execCommand("<p>");return true}}}else{var I=P.pre;if(I){F.removeAllRanges();H=L.cloneRange();var x="";var E=H.startContainer;if(E==I){E=E.childNodes[H.startOffset]}while(E&&E.parentNode!=I){E=E.parentNode}if(E){while(E&&!/^br$/i.test(E.tagName)){E=E.previousSibling}E=E?E.nextSibling:I.firstChild;while(E&&E.nodeType!=3){E=E.firstChild}if(E&&/^(\s+)/.test(E.data)){x=RegExp.$1}}var K=O.createDocumentFragment();var N=O.createElement("br");K.appendChild(N);if(x){N=O.createTextNode(x);K.appendChild(N)}H.insertNode(K);H.setEndAfter(N);H.collapse(false);F.addRange(H);return true}}var B=P.h6||P.h5||P.h4||P.h3||P.h2||P.h1;if(B){var J=L.cloneRange();J.setEndAfter(B);if(!/\S/.test(J.toString())){F.removeAllRanges();J.collapse(false);var D=this.getIframeDoc().createElement("p");J.insertNode(D);J.selectNodeContents(D);J.collapse(true);F.addRange(J);this.execCommand("<p>");return true}}}d._onKeypress=function(y){var w=y.keyCode;if(is_gecko&&!y.shiftKey&&!y.ctrlKey&&!y.altKey&&w==DlKeyboard.ENTER){if(m.call(this)){throw new DlExStopFrameEvent}}this.__rte_keymap.r_foreach(function(A){if(DlKeyboard.checkKey(y,A[0])){this.execCommand(A[1]);throw new DlExStopFrameEvent}},this);if(w==DlKeyboard.TAB){var v=this.queryCommandValue("formatblock");if(v=="pre"){this.insertText(this._tabChar,true);this.collapse(false);throw new DlExStopFrameEvent}}else{if(w==DlKeyboard.ENTER&&is_ie&&!y.shiftKey){var v=this.queryCommandValue("formatblock");if(v=="pre"){var z=this.getSelection(),x=this.getRange(z);x.pasteHTML("<br/><div class='DynarchLIB-REMOVE-ME'></div>");throw new DlExStopFrameEvent}}}};function p(x){x||(x=this.getIframeWin().event);var v=new DlEvent(x);if(v.type=="oncontextmenu"){u.stopEvent(x)}v.origTarget=v.target;var z=v.origPos=v.pos;var y=u.getPos(this.getIframeElement());v.pos={x:z.x+y.x,y:z.y+y.y};v.target=this.getElement();try{DlEvent._genericEventHandler(v,x)}catch(w){if(w instanceof DlExStopFrameEvent){u.stopEvent(x)}}if(/onMouseDown|onMouseUp|onKey/.test(v.dl_type)){this.callUpdateHooks(v,x)}}function a(w){var v=this.getIframeDoc();this.__hasFrameEvents=true;u.addEvents(v,q,this.__eventProxy);if(this.__pendingHTML){this.getIframeBody().innerHTML=this.__pendingHTML;this._onSetHTML();this.moveBOF();this.__pendingHTML=null}this.__rte_onFocus=b.$(this);this.__rte_onBlur=l.$(this);if(is_ie){v=this.getIframeElement();v.onfocus=this.__rte_onFocus}else{u.addEvent(v,"focus",this.__rte_onFocus)}v.onblur=this.__rte_onBlur;if(w){w.call(this)}}function c(){var v=this.getIframeDoc();u.removeEvents(v,q,this.__eventProxy);if(is_ie){v=this.getIframeElement();delete v.onfocus;v.onfocus=null}else{u.removeEvent(v,"focus",this.__rte_onFocus)}delete v.onblur;v.onblur=null}function b(){r(this.getIframeDoc().documentElement,"DlRteFrame-Focused");n.BASE.focus.call(this)}function l(){t(this.getIframeDoc().documentElement,"DlRteFrame-Focused");n.BASE.blur.call(this,true)}});DEFINE_CLASS("DlSocket",DlEventProxy,function(d,c){function a(){return DlFlashUtils().getObject()}d.DEFAULT_EVENTS=["onConnect","onRelease","onData"];d.DEFAULT_ARGS={_host:["host",null],_port:["port",null],_json:["json",false]};d.FIXARGS=function(g){if(!g.host){g.host=document.domain}};d.CONSTRUCT=function(g){this.addEventListener("onDestroy",b);DlEvent.atUnload(this.destroy.$(this))};var f={};function b(){a().DlSocket_destroy(this.id);delete f[this.id]}c.send=function(g){a().DlSocket_send(this.id,g)};c.sendJSON=function(g){a().DlSocket_send(this.id,DlJSON.encode(g))};c.connect=function(){this.id=a().DlSocket_connect(this._host,this._port);f[this.id]=this};c.reconnect=function(){a().DlSocket_reconnect(this.id)};c.disconnect=function(){a().DlSocket_disconnect(this.id)};window.DlSocket_onConnect=function(i,g){f[i].applyHooks("onConnect",[g])};window.DlSocket_onData=function(j,i){i=DlFlashUtils.decodeString(i);var g=f[j];if(g._json){i=DlJSON.decode(i)}g.applyHooks("onData",[i])};window.DlSocket_onDisconnect=function(i,g){f[i].applyHooks("onRelease",[g])}});DEFINE_CLASS("DlSound",DlEventProxy,function(f,d){var g={};function a(){return DlFlashUtils().getObject()}f.DEFAULT_EVENTS=["onLoad","onComplete"];f.DEFAULT_ARGS={_volume:["volume",null],_pan:["pan",null],_url:["url",null],_stream:["stream",false]};f.CONSTRUCT=function(i){this.addEventListener({onDestroy:c,onLoad:b});this.id=a().DlSound_create();if(this._volume!=null){this.setVolume(this._volume)}if(this._pan!=null){this.setPan(this._pan)}g[this.id]=this};d.load=function(i,j){if(i==null){i=this._url}if(j==null){j=this._stream}this.__fileLoaded=false;this.__loadCalled=true;a().DlSound_load(this.id,this._url=i,this._stream=j)};d.play=function(j,i){if(this.__fileLoaded){a().DlSound_play(this.id,j,i)}else{if(!this.__loadCalled){this.__shouldPlay=[j,i];this.load()}}};d.stop=function(){a().DlSound_stop(this.id)};d.getBytesLoaded=function(){return a().DlSound_getBytesLoaded(this.id)};d.getBytesTotal=function(){return a().DlSound_getBytesTotal(this.id)};d.getDuration=function(){return a().DlSound_getDuration(this.id)};d.getPosition=function(){return a().DlSound_getPosition(this.id)};d.setPan=function(i){a().DlSound_setPan(this.id,this._pan=i)};d.setVolume=function(i){a().DlSound_setVolume(this.id,this._volume=i)};d.getPan=function(){return this._pan};d.getVolume=function(){return this._volume};d.getURL=function(){return this._url};function c(){delete g[this.id]}function b(i){this.__fileLoaded=i;if(i&&this.__shouldPlay){this.play.apply(this,this.__shouldPlay);this.__shouldPlay=null}}window.DlSound_onLoad=function(j,i){g[j].applyHooks("onLoad",[i])};window.DlSound_onSoundComplete=function(i){g[i].callHooks("onComplete")}});DEFINE_CLASS("DlSpinner",DlEntry,function(a,g,m){var j=m.createElement;a.FIXARGS=function(o){o.validators=[new DlValidator(DlValidator.Number,o.minVal,o.maxVal,o.integer,o.decimals)];o.type="text"};a.CONSTRUCT=function(){this._timer=null;this._timerStep=null;this._timerState=null;this._timerPos=null};a.DEFAULT_EVENTS=["onSpin"];a.DEFAULT_ARGS={_step:["step",1],_size:["size",4],_value:["value",0],_minVal:["minVal",null],_maxVal:["maxVal",null],_decimals:["decimals",null],_integer:["integer",false]};g.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}];g._createElement=function(){this._no_gecko_bug=true;a.BASE._createElement.call(this);var s=this.getElement();var p=s.rows[0].cells[0];p.rowSpan=2;p=p.parentNode;var o=j("tr",null,null,p.parentNode);var r=j("td",null,{className:"DlSpinner-Button DlSpinner-Button-Up"},p);var q=j("td",null,{className:"DlSpinner-Button DlSpinner-Button-Down"},o);this._buttonUp=new DlButton({parent:this,appendArgs:r});this._buttonDown=new DlButton({parent:this,appendArgs:q});this._btn=this._buttonUp};function l(){this.select()}function c(){this._clearTimer()}function b(o){this._spinnerUpdateVal(o.wheelDelta>0);throw new DlExStopEventBubbling}function k(o){switch(o.keyCode){case DlKeyboard.ARROW_DOWN:f.call(this,{_direction:false});throw new DlExStopEventBubbling;break;case DlKeyboard.ARROW_UP:f.call(this,{_direction:true});throw new DlExStopEventBubbling;break}}function n(o){this._clearTimer()}function i(){var q=this.getValue();var p=q==this._maxVal;var o=q==this._minVal;this._buttonUp.disabled(p||!!this.readonly());this._buttonDown.disabled(o||!!this.readonly());if(p||o){this._clearTimer()}}g._setListeners=function(){a.BASE._setListeners.call(this);this.addEventListener({onFocus:l,onBlur:c,onMouseWheel:b,onKeyDown:k,onKeyUp:n,onChange:i})};g.initDOM=function(){a.BASE.initDOM.call(this);this._setupSpinnerBtn(this._buttonUp,true);this._setupSpinnerBtn(this._buttonDown,false)};g.readonly=function(o){if(o!=null){this._buttonUp.disabled(o);this._buttonDown.disabled(o)}return a.BASE.readonly.apply(this,arguments)};g._spinnerUpdateVal=function(q){if(!this._readonly){var u=new Number(this.getValue());var r=this._timerStep||this._step;u=q?(u+r):(u-r);if(this._minVal!=null&&u<this._minVal){u=this._minVal}if(this._maxVal!=null&&u>this._maxVal){u=this._maxVal}this.setValue(u);this.applyHooks("onSpin",[u]);this.focus();this.select();if(this._timer){var s=++this._timerPos;if(this._timerState.length&&s==this._timerState[0].pos){var t=this._timerState.shift();this._clearTimer(true);this._timerStep=t.step;this._startTimer(q,t.speed)}}}};function f(o){this._spinnerUpdateVal(o._direction);(this._timerState=Array.$(this.intervals)).r_foreach(function(p){p.step*=this.step},this);this._timerPos=0;this._startTimer(o._direction,250);throw new DlExStopEventBubbling}function d(o){this._clearTimer()}g._clearTimer=function(o){if(this._timer){clearInterval(this._timer)}if(!o){this._timerState=null;this._timerStep=null;this._timerPos=null}this._timer=null};g._startTimer=function(o,p){if(this._timer){clearInterval(this._timer)}this._timer=setInterval(this._spinnerUpdateVal.$(this,o),p)};g._setupSpinnerBtn=function(q,p){q._direction=p;var o=d.$(this,q);q.addEventListener({onMouseDown:f.$(this,q),onMouseUp:o})}});DEFINE_CLASS("DlStyleSheet",DlEventProxy,function(d,c,b){d.CONSTRUCT=function(){this._init()};function a(){b.trash(this._el);this._s=null;this._el=null}c.insertRule=function(o,m,g){var l=this._s;if(g==null){g=this.getRules().length}if(typeof m=="object"){var k=[];for(var j in m){k.push(j+":"+m[j])}m=k.join(";")}else{if(m instanceof Array){m=m.join(";")}}if(is_ie){o=o.split(/\s*,\s*/);if(o.length==1){l.addRule(o,m,g)}else{var n=b.ID();var f=this._ier[n]=[];for(var j=0;j<o.length;++j){l.addRule(o[j],m,g+j);f.push(this.getRules()[g+j])}return n}}else{l.insertRule(o+"{"+m+"}",g)}return this.getRules()[g]};c.deleteRule=function(g){if(is_ie&&typeof g=="string"){this._ier[g].foreach(this.deleteRule.$(this));delete this._ier[g]}else{var j=this.getRules();for(var f=j.length;--f>=0;){if(j[f]===g){if(is_ie){this._s.removeRule(f)}else{this._s.deleteRule(f)}return f}}}};c.modifyRule=function(j,g){if(is_ie&&typeof j=="string"){this._ier[j].foreach(function(i){this.modifyRule(i,g)},this)}else{for(var f in g){j.style[f]=g[f]}}};c.refresh=function(){var f=this.disabled();this.disabled(!f);this.disabled(f)};c.getRules=function(){return is_ie?this._s.rules:this._s.cssRules};c.disabled=function(f){var g=is_ie?this._s:this._el;if(f!=null){g.disabled=f}return !!g.disabled};c._init=function(){if(is_ie){this._ier={}}this._el=b.createElement("style",null,{type:"text/css"},document.getElementsByTagName("head")[0]);this._s=document.styleSheets[document.styleSheets.length-1];this.addEventListener("onDestroy",a)}});DEFINE_CLASS("DlTabs",DlContainer,function(g,d,c){g.DEFAULT_EVENTS=["onChange"];g.DEFAULT_ARGS={_tabPos:["tabPos","top"]};function b(k,j,l){var i=j!=null?this._panes[j]:null;i&&i._tab.checked(true);k.applyHooks("onChange",[j,l])}function a(i){if(i.checked()){this._tabContent.showPane(i.userData)}}function f(i){this.checked(true);throw new DlExStopEventProcessing()}d.addTab=function(i,j,k){this._tabContent.appendWidget(i,k);i._tab=new DlButton({label:j,parent:this._tabBar,group:this._tabGroup,type:DlButton.TYPE.TWOSTATE,data:this._tabContent.length()-1});i._tab.addEventListener("onClick",f,true);i.addEventListener("onDestroy",i._tab.destroy.$(i._tab))};d.getTabBar=function(){return this._tabBar};d.getNotebook=function(){return this._tabContent};d.getTabButton=function(i){return this.getNotebook().getPane(i)._tab};d.getTabContent=d.getNotebook;d.initDOM=function(){g.BASE.initDOM.call(this);this._tabGroup=DlRadioGroup.get(this.id);this._tabBar=new DlHbox({className:"TabBar"});this._tabContent=new DlNotebook({className:"TabContent"});switch(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);break}this._tabContent.addEventListener("onChange",b.$(this._tabContent,this));this._tabGroup.addEventListener("onChange",a.$(this));this.addClass("DlTabs-"+this._tabPos)};d.setTabPos=function(i){var k=this._tabBar.getElement();var j=this._tabContent.getElement();if(k.parentNode){k.parentNode.removeChild(k)}var l=(i=="top"||i=="left")?l=j:null;j.parentNode.insertBefore(k,l);this.addClass("DlTabs-"+i,"DlTabs-"+this._tabPos);this._tabPos=i};d.setTabAlign=function(i){return this._tabBar.setAlign(i)};d.setOuterSize=d.setSize=function(i){g.BASE.setSize.call(this,i);i=this.getInnerSize();var j=this._tabBar.getSize();switch(this._tabPos){case"top":case"bottom":i.y-=j.y;break;case"left":case"right":i.x-=j.x;break}this._tabContent.setSize(i)};d.showPane=function(i){return this._tabContent.showPane(i)};d.nextPane=function(){return this._tabContent.nextPane()};d.prevPane=function(){return this._tabContent.prevPane()};d.isFirstPane=function(){return this._tabContent.isFirstPane()};d.isLastPane=function(){return this._tabContent.isLastPane()};d.getCurrentPane=function(){return this._tabContent.getCurrentPane()};d.getCurrentPaneIndex=function(){return this._tabContent.getCurrentPaneIndex()};d._handle_focusKeys=function(j){if(j.shiftKey){if(j.keyCode==DlKeyboard.PAGE_UP){this.prevPane();this.getCurrentPane()._tab.focus();DlException.stopEventBubbling()}else{if(j.keyCode==DlKeyboard.PAGE_DOWN){this.nextPane();this.getCurrentPane()._tab.focus();DlException.stopEventBubbling()}}}else{if(j.keyCode==DlKeyboard.TAB&&this._tabBar.focusInside()){var i=this.getCurrentPane().getFirstFocusWidget();if(i){i.focus();DlException.stopEventBubbling()}}}}});DlTextUtils=(function(){var a,l=DynarchDomUtils,k=DlKeyboard,d=[(/^(\s*[-*]+\s+)/),function(n){return[n," ".x(n[0].length),n[0].length]},(/^(\s*)([0-9]+)(\.\s+)/),function(n){return[function(){var m=parseInt(n[2],10)+1;return n[1]+m+n[3]}," ".x(n[0].length),n[0].length]},(/^(\s*)([a-z])(\)\s+)/i),function(n){return[function(){var m=String.fromCharCode(n[2].charCodeAt(0)+1);return n[1]+m+n[3]}," ".x(n[0].length),n[0].length]},(/^\s*([>|]\s*)*/),function(n){return[n,n[0],n[0].length,/\n\s*([>|]\s*)*/g,"\n"]},(/^\s+/),function(n){return[n,n[0],n[0].length]}];var i=[k.ARROW_UP,k.ARROW_DOWN].toHash(true);var g=String.fromCharCode(0);function f(u){if(!u){u=window.event}var r=l.getSelectionRange(this),w={x:this.scrollLeft,y:this.scrollTop};function q(){this.scrollLeft=w.x;this.scrollTop=w.y;return l.stopEvent(u)}if(u.altKey&&u.charCode==113){var o=a.fillText(this.value,72,r.start);this.value=o.text;l.setSelectionRange(this,o.pos,o.pos);return q.call(this)}if(u.ctrlKey&&(u.keyCode in i)){var n=u.keyCode==k.ARROW_UP,m=a.getParagraph(this.value,n?r.start:r.end),t;t=(n?m.start-1:m.end+1).limit(0,this.length);l.setSelectionRange(this,u.shiftKey?(n?r.end:r.start):t,t);return l.stopEvent(u)}if(u.altKey&&u.keyCode==k.ENTER){var x=this.value,m=a.getParagraph(x,r.start),v=a.getFillPrefix(m.text),s=v[0];if(typeof s=="function"){s=s(v)}else{s=s[0]}x=x.substr(0,m.end)+"\n\n"+s+x.substr(m.end);this.value=x;l.setSelectionRange(this,m.end+2+s.length);return q.call(this)}}var b=/\n([>|\s]*\n)+/g;function c(r,p,q){var n,s=-1;p.lastIndex=0;p.global=true;var o=-1;while((n=p.exec(r))){if(p.lastIndex>=q){break}s=p.lastIndex;if(s==o){throw"Repeated! "+s}o=s}return s}function j(q,o,p){o.lastIndex=p;o.global=true;var n=o.exec(q);return n?n.index:null}return a={getParagraph:function(n,p){var o=c(n,b,p+1),m=j(n,b,p);if(o==-1){o=0}if(m==null){m=n.length}return{start:o,end:m,text:n.substring(o,m)}},getFillPrefix:function(o){var p=0,q,r,n;o=o.replace(/\x00/g,"");while(p<d.length){q=d[p++];r=d[p++];q.lastIndex=0;if((n=q.exec(o))){return r(n)}}},fillParagraph:function(y,n,t){y=y.substr(0,t)+g+y.substr(t);var v=a.getFillPrefix(y),r=v[1],q=v[2];var u=y.substr(0,q);y=y.substr(q);if(v[3]){y=y.replace(v[3],function(m){return v[4]||""})}y=y.replace(/\n/g," ").replace(/([^.?!])\s\s+/g,"$1 ");var w=new RegExp("(.{0,"+(n-r.length)+"})(\\s+|$)","g");var p,o=[],s=0,x;while((p=w.exec(y))){if(w.index!=s){x=y.substring(s,w.lastIndex)}else{x=p[1]}s=w.lastIndex;if(!/\S/.test(x)){break}o.push(x.trim(true))}y=u+o.join("\n"+r);t=y.indexOf(g);if(t>=0){y=y.substr(0,t)+y.substr(t+1)}return{text:y,pos:t}},fillText:function(t,o,u){var r=a.getParagraph(t,u);var q=t.substr(0,r.start),s=t.substr(r.end);var m=u-r.start;var n=a.fillParagraph(r.text,o,m);return{text:q+n.text+s,pos:r.start+n.pos}},emacsipateTextarea:function(m){l.addEvent(m,is_ie?"keydown":"keypress",f)}}})();DEFINE_CLASS("DlTooltip",DlPopup,function(b,a){b.FIXARGS=function(c){c.zIndex=2000;c.focusable=false;this._mouseDiff={x:8,y:12}}});DEFINE_CLASS("DlTree",DlContainer,function(c,b,a){c.CONSTRUCT=function(){this.__treeItems=[]};b.getItem=function(d){return this.__treeItems[d]};b.getItems=function(){return this.__treeItems};b.appendWidget=function(d,f){if(d instanceof DlTreeItem&&d.parent===this&&f>d.getIndex()){--f}c.BASE.appendWidget.call(this,d,f)};b.removeWidget=function(f){c.BASE.removeWidget.call(this,f);if(f instanceof DlTreeItem){var g=this.__treeItems.find(f);this.__treeItems.splice(g,1);var d=this.__treeItems.length;if(d==0){if(this.parent instanceof DlTreeItem){this.destroy()}}else{if(g==0){this.__treeItems[g]._setFirstLast(true,null)}if(g==d){this.__treeItems[g-1]._setFirstLast(null,true)}}}};b._appendWidgetElement=function(f,k){var d=this.__treeItems;var g=this.getContentElement();if(k==null){if(f instanceof DlTreeItem){var j=d.peek();j?j._setFirstLast(null,false):f._setFirstLast(true,null);d.push(f);f._setFirstLast(null,true)}g.appendChild(f.getElement())}else{if(k==d.length){return this._appendWidgetElement(f,null)}var i=d[k];if(i){i._setFirstLast(false,k==d.length-1)}f._setFirstLast(k==0,false);d.splice(k,0,f);g.insertBefore(f.getElement(),g.childNodes[k])}};b.addSeparator=function(d){a.createElement("div",null,{className:d||"DlTree-separator",innerHTML:"&nbsp;"},this.getElement())}});DEFINE_CLASS("DlTreeItem",DlContainer,function(a,f,m){var g=m.createElement,d=m.addClass,c=m.delClass,k=m.condClass;a.CONSTRUCT=function(){this.setIconClass(this.__iconClass);this.__iconClass=null};a.DEFAULT_ARGS={__label:["label",null],__iconClass:["iconClass",null],__itemClass:["itemClassName",null]};a.DEFAULT_EVENTS=["onExpand","onCollapse","onLabelMouseDown"];var b=("<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>");function j(p){var o=p.target;try{while(o&&o.tagName.toLowerCase()!="td"){o=o.parentNode}}catch(n){o=null}return o}function i(n){var o=j(n);if(o&&/DlTreeItem-(Expander|Icon)/.test(o.className)){this.toggle();throw new DlExStopEventBubbling}}function l(){var n=this.getSubtreeDiv();if(!window.DL_CLOSING){m.trash(n)}m.removeEvent(this.getDivElement(),"mousedown",this.__onLabelMouseDown)}f._setFirstLast=function(n,o){if(n!=null){this.condClass(n,"DlTreeItem-First");k(this.getTableElement(),n,"DlTreeItem-First")}if(o!=null){this.condClass(o,"DlTreeItem-Last");k(this.getTableElement(),o,"DlTreeItem-Last")}};f._setListeners=function(){a.BASE._setListeners.call(this);this.addEventListener({onMouseDown:i,onDestroy:l})};f._createElement=function(){a.BASE._createElement.call(this);this.getElement().innerHTML=b;if(this.__label){this.setContent(this.__label)}this.setUnselectable();this.__onLabelMouseDown=this._onLabelMouseDown.$(this);m.addEvent(this.getDivElement(),"mousedown",this.__onLabelMouseDown);if(this.__itemClass){d(this.getDivElement(),this.__itemClass)}};f._onLabelMouseDown=function(n){this.callHooks("onLabelMouseDown")};f.getDivElement=function(){return this.getElement().firstChild};f.getTableElement=function(){return this.getElement().firstChild.firstChild};f.getExpanderElement=function(){return this.getTableElement().rows[0].cells[0]};f.getIconElement=function(){return this.getTableElement().rows[0].cells[1]};f.getContentElement=function(){return this.getTableElement().rows[0].cells[2]};f.getSubtreeDiv=function(){return this.getElement().childNodes[1]};f.getSubtreeWidget=function(){return this._subtree};f.getIndex=function(){return this.parent.__treeItems.find(this)};f.getParentItem=function(){return this.parent.parent};f.addSubItem=function(o,p){var n=this.getSubtreeWidget();if(!n&&!this._tree){n=new DlTree({});this.setTree(n);this.expand()}n.appendWidget(o,p)};f.setTree=function(n,o,p){if(this._tree&&(typeof this._tree!="function")){this.removeWidget(this._tree)}this._tree=n;if(n!=null){if(typeof n!="function"){this.appendWidget(n,true)}else{if(o==null){o=false}}if(o){this.expand(o)}else{this.getSubtreeDiv().style.display="none";this.updateExpanderState()}}if(p==null){this._subtreeNeverExpires=true;this._subtreeExpires=null}else{this._subtreeNeverExpires=false;this._subtreeExpires=new Date().getTime()+p}this.condClass(n,"DlTreeItem-hasSubtree");this.updateExpanderState()};f.isExpanded=function(){return this.getSubtreeDiv().style.display!=="none"};f.toggle=function(){this.expand(!this.isExpanded())};f.getPath=function(){var o=[];var n=this.getParentItem();while(n instanceof DlTreeItem){o.push(n);n=n.getParentItem()}return o};f.expandParents=function(n){var o=this.getParentItem();while(o instanceof DlTreeItem){o.expand(n);o=o.getParentItem()}};f.expand=function(r,q){if(r==null){r=true}var p=this;function n(){p.getSubtreeDiv().style.display=r?"block":"none";p.updateExpanderState();if(!q){p.callHooks(r?"onExpand":"onCollapse")}}function o(t,w){var v=p._tree;if(p._subtree){try{p._subtree.destroy()}catch(u){}}p._tree=v;if(w==null){p._subtreeNeverExpires=true;p._subtreeExpires=null}else{p._subtreeNeverExpires=false;p._subtreeExpires=new Date().getTime()+w}p.appendWidget(t,true);n()}if(r!==this.isExpanded()){if(r&&typeof this._tree=="function"){if(this._subtree){if(this._subtreeNeverExpires){n()}else{var s=new Date().getTime();if(this._subtreeExpires&&s<=this._subtreeExpires){n()}else{this._tree(o,this)}}}else{this._tree(o,this)}}else{n()}}};f.setIconClass=function(n){var o=this.getIconElement();k(o,n!=null,"DlTreeItem-Icon");if(this.iconClass){o.innerHTML="";c(o,this.iconClass)}if(n){o.innerHTML="<div class='DlTree-IconWidth'>&nbsp;</div>";d(o,n)}this.iconClass=n};f.updateExpanderState=function(){var o=this.getExpanderElement().firstChild;if(this._tree){var n=this.isExpanded();k(o,n,"DlTreeItem-Arrow-Expanded","DlTreeItem-Arrow-Collapsed");k(this.getTableElement(),n,"DlTreeItem-Table-Expanded","DlTreeItem-Table-Collapsed")}else{c(o,"DlTreeItem-Arrow-Expanded");c(o,"DlTreeItem-Arrow-Collapsed");this.delClass("DlTreeItem-hasSubtree")}};f._appendWidgetElement=function(n,q){var p=n.getElement(),o;if(n instanceof DlTreeItem){this.addSubItem(n,q)}else{o=(q||n instanceof DlTree)?this.getSubtreeDiv():this.getContentElement();if(q){this._subtree=n;d(p,"DlTree-withLines");this.addClass("DlTreeItem-hasSubtree")}o.appendChild(p)}};f._removeWidgetElement=function(n){a.BASE._removeWidgetElement.call(this,n);if(!this.getSubtreeDiv().firstChild){this._tree=null;this._subtree=null}this.updateExpanderState()};f._setFocusedStyle=function(n){k(this.getDivElement(),n,"DlTreeItem-div-focus")}});function DlType(a){if(a){this.name=a;DlType.TYPES[a]=this}}DlType.TYPES={};DlType.prototype={getDisplayValue:function(a){return a},compare:function(d,c){throw"No comparator for type: "+this.name}};DEFINE_CLASS("DlUploadEntry",DlWidget,function(d,c,b){d.DEFAULT_EVENTS=["onUploadStart","onUploadEnd","onChange"];d.DEFAULT_ARGS={_url:["url",null],_files:["files",["file"]],_params:["params",null]};d.BEFORE_BASE=function(){if(!(this._files instanceof Array)){this._files=[this._files]}};c._createElement=function(){d.BASE._createElement.call(this);var g=b.createElement("iframe",null,{frameBorder:0,marginHeight:0,marginWidth:0,allowTransparency:true,src:is_ie?"javascript:'';":"about:blank"},this.getElement());this.refNode("_iframe",g)};c.init=function(){var n=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(),"' />");var m=this._params;if(m){if(m instanceof Array){m=m.toHash("")}for(var g in m){n("<input type='hidden' name='",g,"' value='",m[g],"' />")}}this._files.foreach(function(i){n("<label class='upload'><input type='file' name='",i,"' /></label>")});n("</form></body></html>");var l=this._iframe.contentWindow;var k=l.document;k.open();k.write(n.get());k.close();this.refNode("_win",l);this.refNode("_doc",k);this.refNode("_form",k.getElementsByTagName("form")[0]);this._form.method="POST";this._form.encoding="multipart/form-data";var j=a.$(null,this);this._files.foreach(function(i){var o=this._form.elements.namedItem(i);o.onchange=j;o.parentNode.onmousemove=f},this)};c.setParam=function(g,l){if(typeof g=="string"){var k=this.getField(g);if(!k){k=this._doc.createElement("input");k.type="hidden";k.name=g;this._form.appendChild(k)}k.value=l}else{for(var j in g){this.setParam(j,g[j])}}};c.getParam=function(g){var i=this.getField(g);return i&&i.value};c.getField=function(g){return this._form.elements.namedItem(g)};c.submit=function(){this.callHooks("onUploadStart");this._form.submit()};d.finishUpload=function(g){if(!(g instanceof DlUploadEntry)){g=DlWidget.getById(g)}if(g){g.init();g.applyHooks("onUploadEnd",Array.$(arguments,1))}else{throw ("No such uploader: "+g)}};function a(g){g.applyHooks("onChange",[this,this.name,this.value])}function f(g){if(is_ie){g=this.ownerDocument.parentWindow.event}this.firstChild.style.right=30-g.clientX+"px"}});DEFINE_EXCEPTION("DlValidatorException");DlValidatorException.MISMATCH=1;DlValidatorException.TOO_SMALL=2;DlValidatorException.TOO_BIG=3;DEFINE_CLASS("DlValidator",null,function(c,a){c.CONSTRUCT=function(d){if(d){if(typeof d=="string"){d=c[d]}this._callback=d;this._args=arguments.length>1?Array.$(arguments,1):null}};a.ok=function(g){if(typeof this._lastData!="undefined"&&this._lastData===g){return true}try{var d=[g].concat(this._args||Array.$(arguments,1));var i=this._callback.apply(this,d);this._lastData=g;this._lastValue=i;return true}catch(f){if(f instanceof DlValidatorException){this._error=f;return false}else{throw f}}};a.getLastVal=function(){return this._lastValue};a.getLastData=function(){return this._lastData};a.getError=function(){return this._error};c.Number=function(i,d,k,g,f){i=i.replace(/\s/g,"");var j=new Number(i);if(isNaN(j)){throw new DlValidatorException("Value must be numeric",DlValidatorException.MISMATCH)}if(g&&j!=Math.round(j)){throw new DlValidatorException("Value must be an integer",DlValidatorException.MISMATCH)}if(d!=null&&j<d){throw new DlValidatorException("Value must be bigger than "+d,DlValidatorException.TOO_SMALL)}if(k!=null&&j>k){throw new DlValidatorException("Value must be smaller than "+k,DlValidatorException.TOO_BIG)}if(f){j=j.toFixed(f)}return j};c.Email=function(d){if(!/^([^@\n\r]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i.test(d)){throw new DlValidatorException("That doesn't look like an email address",DlValidatorException.MISMATCH)}return d};c.URL=function(f,d){if(!d){d={}}if(!/^(https?|ftps?):\x2f\x2f/.test(f)){throw new DlValidatorException("Value must be an absolute URL",DlValidatorException.MISMATCH)}return f};function b(i){i=i.toLowerCase();function g(f){return f.foreach(function(k,j){if(k.toLowerCase().indexOf(i)==0){$RETURN(j)}})}var d=g(DlTEXTS._date_shortMonthNames)||g(DlTEXTS._date_monthNames);if(d!=null){d++}return d}c.Date=function(i,p,d){if(!/\S/.test(i)){return""}if(!p){p="%Y-%m-%d"}i=i.replace(/^\s+/,"").replace(/\s+$/,"");var k=new Date();var q=null,g=null,t=null,j=null,f=null,r=null;var n=i.match(/([0-9]{1,2}):([0-9]{1,2})(:[0-9]{1,2})?\s*(am|pm)?/i);if(n){j=parseInt(n[1],10);f=parseInt(n[2],10);r=n[3]?parseInt(n[3].substr(1),10):0;i=i.substring(0,n.index)+i.substr(n.index+n[0].length);if(n[4]){if(n[4].toLowerCase()=="pm"&&j<12){j+=12}else{if(n[4].toLowerCase()=="am"&&j>=12){j-=12}}}}var o=i.split(/\W+/);var l=[];o.foreach(function(m){if(/^[0-9]{4}$/.test(m)){q=parseInt(m,10);if(!g&&!t){d=true}}else{if(/^[0-9]{1,2}$/.test(m)){m=parseInt(m,10);if(m>=60){q=m}else{if(m>=0&&m<=12){l.push(m)}else{if(m>=1&&m<=31){t=m}}}}else{g=b(m)}}});if(l.length>=2){if(d){if(!g){g=l.shift()}if(!t){t=l.shift()}}else{if(!t){t=l.shift()}if(!g){g=l.shift()}}}else{if(l.length==1){if(!t){t=l.shift()}else{if(!g){g=l.shift()}}}}if(!q){q=l.length>0?l.shift():k.getFullYear()}if(q<30){q+=2000}else{if(q<99){q+=1900}}if(!g){g=k.getMonth()+1}if(q&&g&&t){this._date=new Date(q,g-1,t,j,f,r)}else{this._date=null;throw new DlValidatorException("Can't figure out this date",DlValidatorException.MISMATCH)}return this._date.print(p)}});function DlConsole(){this._messages=[];DlConsole.INSTANCE=this}DlConsole.prototype={log:function(a){a=a.printf.apply(a,Array.$(arguments,1));this._addMsg({str:a})},line:function(){this._addMsg({str:"&nbsp;",cls:"sep"})},CC:function(a,c){var b=this.win.document.createElement("div");b.className=c||"msg";b.innerHTML=a;this.win.document.body.appendChild(b);this.win.scrollTo(0,b.offsetTop+b.offsetHeight);if(this._last){DynarchDomUtils.delClass(this._last,"current")}DynarchDomUtils.addClass(b,"current");this._last=b},_addMsg:function(a){this._init();if(!this.win){this._messages.push(a)}else{this.CC(a.str,a.cls)}},_init:function(){if(!this.win){window.open(Dynarch.getFileURL("html/dlconsole.html"),"DlConsole","height=400,width=600,menubar=0,toolbar=0,scrollbars=1")}},_loaded:function(a){this._last=null;this.win=a;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{var a=[];for(var i=0;i<arguments.length;++i){a.push(arguments[i])}console.log(name+" ["+a.join(", ")+"]");func.apply(this,arguments)}catch(ex){alert("Exception in "+name+"\n"+ex);throw ex}};eval(name+" = f")}};if(!window.dlconsole){window.dlconsole=new DlConsole()};